+ Reply to Thread
Results 1 to 3 of 3

Select ribbon tab when condition is met

  1. #1
    Registered User
    Join Date
    08-02-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2010
    Posts
    37

    Select ribbon tab when condition is met

    Hi all,

    I am trying to select a certain ribbon tab based on what business unit a user belongs to. This would mean that if a user belongs to business unit X the tab "Actions X" would be selected (the other tabs are still visible though) while a user belonging to business unit Y would get the "Actions Y" tab selected (again, with all other tabs available and visible, yet not selected). The code would look something like this I supppose, I just dont know how it would work

    Thanks!

    Please Login or Register  to view this content.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: Select ribbon tab when condition is met

    This will work in xl2010 and newer.

    module code

    Please Login or Register  to view this content.
    Sheet1 event code which allows tab activation via data validation drop down

    Please Login or Register  to view this content.
    You will probably have some other code to determine which tabid to activate.

    ribbon xml
    <customUI
    xmlns="http://schemas.microsoft.com/office/2009/07/customui"
    onLoad="ribbon_onLoad">
    <ribbon >
    <tabs >
    <tab
    id="UNIT1"
    label="Unit1">
    <group
    id="Group1"
    label="Group1"/>
    </tab >
    <tab
    id="UNIT2"
    label="Unit2">
    <group
    id="Group2"
    label="Group2"/>
    </tab >
    <tab
    id="UNIT3"
    label="Unit3">
    <group
    id="Group3"
    label="Group3"/>
    </tab >
    </tabs >
    </ribbon >
    </customUI >
    If you need to do this in xl2007 then you can use the approach outlined in Tony Jollan's article.
    http://www.wordarticles.com/Shorts/R...bonVBADemo.php
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    08-02-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2010
    Posts
    37

    Re: Select ribbon tab when condition is met

    Thanks Andy!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Ribbon Change based on Non-Ribbon Object
    By diakonos1984 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 11-07-2014, 01:18 PM
  2. [SOLVED] An alternative to the Add-Ins ribbon tab - Global Custom Ribbon Tab by Ken Puls
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-16-2014, 10:01 PM
  3. Disable Grey Out condition formatting in Ribbon
    By edwardhdwang in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-30-2012, 07:27 PM
  4. Select worksheet based on condition & populate cell based on condition
    By beth1069 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-19-2011, 01:27 PM
  5. Ribbon - Multiple xlam adding into single Ribbon tab
    By gooopil in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-09-2011, 03:40 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1