Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Custom Tab in Ribbon - How to attach to one particular file?

Status
Not open for further replies.

MattGreer

Technical User
Feb 19, 2004
471
US
I searched but didn't find this referenced to Excel 2010 or greater. I'm using Excel 2013.

I have a file that contains a table of items that I sort and manipulate and apply formatting and so forth using macros. I wanted to add those macros to a custom Tab, so I did. Problem is that Custom Tab shows up whenever I open Excel now, rather than just being attached to that one file (which is what I want).

How do I set up a custom Tab that only opens when I open the file that contains the source VBA?


Thanks!!


Matt
 
Since you "have a file {...} using macros", you may as well add a little code to add your Tab to your Ribbon just for that file, and not the others:

Code:
Option Explicit

Private Sub Workbook_Open()
    AddMyTabToRibbon
End Sub

Sub AddMyTabToRibbon()[green]
'Some code here to do that
[/green]
End Sub

Have fun.

---- Andy

There is a great need for a sarcasm font.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top