Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 67
Default Changing worksheet tab colors

Greetings all!

I have a spreadsheet created in Excel 2007 that I am looking to have the tab
of each sheet the same color as a specific cell within that sheet. The cell
(M20) is a results cell that contains a short formula and has conditional
formatting which will shade the cell green if positive or red if negative. I
would like each tab for each sheet to either be green or red depending on the
color of cell M20.

Is this possible? If not, can I have a check-box so that if selected the
tab for the sheet will turn a specific color?

Thanks in advance.

Mark

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 772
Default Changing worksheet tab colors

in the workbook module you can put this, the example checks each tab any time
one is clicked and sets its colorindex to the value in M20. Colorindex
requires a number but you can play with it to get it how you want it.
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
For i = 1 To Sheets.Count
Sheets(i).Tab.ColorIndex = Cells(13, 20)

Next
End Sub

Or to go off of the value you can hard code something like

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
For i = 1 To Sheets.Count
if Sheets(i).Cells(13, 20)<=0 then Sheets(i).Tab.ColorIndex = 3
if Sheets(i).Cells(13, 20)0 then Sheets(i).Tab.ColorIndex = 4
Next
End Sub

change the number to change the color
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"MarkT" wrote:

Greetings all!

I have a spreadsheet created in Excel 2007 that I am looking to have the tab
of each sheet the same color as a specific cell within that sheet. The cell
(M20) is a results cell that contains a short formula and has conditional
formatting which will shade the cell green if positive or red if negative. I
would like each tab for each sheet to either be green or red depending on the
color of cell M20.

Is this possible? If not, can I have a check-box so that if selected the
tab for the sheet will turn a specific color?

Thanks in advance.

Mark

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
changing colors widman Excel Discussion (Misc queries) 3 October 16th 06 12:53 AM
Changing colors? Lee Excel Discussion (Misc queries) 1 May 23rd 06 03:11 AM
Changing the colors Prado Excel Discussion (Misc queries) 2 March 3rd 05 06:41 PM
Changing colors davetteb Charts and Charting in Excel 1 February 18th 05 12:17 AM
Changing colors of tabs Christopher Anderson Excel Discussion (Misc queries) 2 November 29th 04 04:09 PM


All times are GMT +1. The time now is 07:55 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"