VBA auto hide ribbon in Excel 2013

前端 未结 7 2093
慢半拍i
慢半拍i 2020-12-14 12:13

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

相关标签:
7条回答
  • 2020-12-14 12:43

    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.

    0 讨论(0)
提交回复
热议问题