Conditional Tab Color

hedgie

Board Regular
Joined
Jun 23, 2004
Messages
164
Actually a two part question. One sheet in a workbook is a testing sheet to see if certain conditions are met. I would like to have the Tab color turn Red if any of the Conditions are present. Currently the sheet has conditional formating for each condition and sets the color to yellow within the cell that is meeting that particular condition. 1) is there a way to populate a test cell that will put a "1" in place if any of the other cells are yellow. 2) if that test cell has a 1, have the tab color change to red?
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

erik.van.geit

MrExcel MVP
Joined
Feb 1, 2003
Messages
17,832
Hi,

1. CELL = 1
you will need to use the formulas from conditional format
this is the only way to "see" if the cells are yellow
2. TABcolor
Code:
Private Sub Worksheet_Calculate()
Me.Tab.ColorIndex = IIf(Range("A1") = 1, 3, -4142)
End Sub
http://www.cpearson.com/excel/events.htm
TO INSTALL IN SHEET CODE WINDOW:
1. right click the "Name Tab" of sheet you want code to work in
2. Select "View Code" in drop down menu
3. VBE window will open ... paste code in and exit VBE

kind regards,
Erik
 

Forum statistics

Threads
1,141,094
Messages
5,704,306
Members
421,337
Latest member
DeuxMilleSangue

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top