Microsoft Excel

Ron de Bruin
Excel Automation

Microsoft MVP Program

Hide or Display Ribbon Tab/Group with getVisible

Information

If you are not familiar with creating Custom Tabs, Groups or controls on the Ribbon with RibbonX follow the steps on this page first before you start with the examples on this page.

In the example workbooks I show you how you can use the getVisible callback to Hide or Display a Custom Tab or Group on the Ribbon and also how to activate the tab.

To be able to Hide/Display a Tab, Group or Control with VBA code I add getVisible="GetVisible" in the RibbonX line that add the Tab or Group to the workbook. You also see tag="YourTagName" in this xml line, we use this Tag in the code to tell which tab/group we want to make visible.
Use the Custom UI Editor to see or edit the RibbonX and the VBA editor to look at the code.

Note: I also paste the RibbonX on the worksheets in the example workbooks so you not need the
Custom UI Editor to see it.

Download Example files

Download the example workbooks
16-Jan-2021 (5 files)

1 : Activate-Custom_Tab.xlsm
2 : Hide-Display-Group.xlsm
3 : Hide-Display-ContextualTabs.xlsm
4 : Hide-Display-Custom-Tab.xlsm
5 : Different-Tab-For-Each-Worksheet.xlsm