Change tab colors via programming

B

Bob

I have created a calendar with separate sheets per week (so....52 sheets for
a year). I use conditional formatting to color the current day on the sheet
but I would like to color the tab as well. I want the current days' tab to
be yellow. I have tried several things but nothing works. Not sure where to
put the code (right click the tab and "View Code" I think, but not sure). I
want it to activate automatically.
Is this possible?
 
C

Chip Pearson

Colored tabs were introduced in Excel 2002 (XP). You can't change the
colors in earlier versions. To change a tab programmatically, use

Worksheets("Sheet2").Tab.ColorIndex = 3 'red

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top