How to Auto-hide Ribbon
in Excel 2013 in VBA? I would like to achieve exactly what I get by clicking on the upper arrow icon at the right top of Excel menu mark
First, go to the Excel Options, and go to "Quick Action Toolbar".
From there, search for "Hide Ribbon" and add to the toolbar. After it's on the QAT, you can call it quickly with ALT+# (on my computer it's the 8th thing, so ALT+8 will auto-hide).
Then just add a sub that does SendKeys ALT then 8:
Sub Macro1()
ActiveSheet.Activate
'Cells(1, 1).Select
SendKeys "%0", True
SendKeys "8", True
End Sub
Note: I know it's silly to have ActiveSheet.Activate
, I just added that to test the macro. Depending on how it's being called, you can remove/comment out that line. The %
is equivalent to ALT
, and technically, I have to press 0 then 8, hence the two lines.