Solved Excel Add-in Select a Tab

Posted on 2012-09-18
Last Modified: 2012-09-19

I have an Excel Add-in with  5 ribbon tabs

What code would I use from a standard module to select a tab

Something similar to the following?

 Globals.Ribbons.Ribbon1.Tab1.Visible = True
Question by:murbro
    LVL 17

    Accepted Solution

    you are very close

    here is an example of how to set the tab in the ribbon depending on the sheet selected

    Dim tabtoActivate As Microsoft.Office.Tools.Ribbon.RibbonTab = Nothing
                If (sheet.Name = "Sheet1") Then
                    tabtoActivate = Globals.Ribbons.CustomRibbon.Tabs(0)
                ElseIf (sheet.Name = "Sheet2") Then
                    tabtoActivate = Globals.Ribbons.CustomRibbon.Tabs(1)
                End If

    Microsoft provide a very easy example of this that you can download as a solution - check out

    Author Closing Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
    Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
    The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
    This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now