Microsoft Excel
Back to jkp-ads.com

Ron de Bruin
Excel Automation

Microsoft MVP Program

Hide or Display Ribbon Tab/Group with getVisible

Important message to visitors of this page

Ron de Bruin decided to remove all Windows Excel content from his website for personal reasons. If you want to know why, head over to rondebruin.nl.

Luckily, Ron was kind enough to allow me to publish all of his Excel content here.

Most of these pages are slightly outdated and may contain links that don 't work. Please inform me if you find such an error and I'll try to fix it.

Kind regards

Jan Karel Pieterse


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