View Full Version : Worksheet tab color based on data?


AtLarge
02-09-2011, 01:42 PM
Does anyone know if it's possible to change the color of the worksheet tab based on information in another cell?

It would be a really nice feature if the tab color could be controlled by a cell in that worksheet. That way you could flag the user easily if that worksheet needs to be looked at. I see View Code or wonder if Conditional Formatting could be made to work but I don't know how. I searched this website and the net but find nothing. Any suggestions?

Brianwarnock
02-10-2011, 09:13 AM
You could something like this

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = "$A$1" Then
If Target.Value = 2 Then
ActiveSheet.Tab.ColorIndex = 3
Else
ActiveSheet.Tab.ColorIndex = xlColorIndexNone
End If
End If

End Sub

Brian

AtLarge
02-10-2011, 10:38 AM
Thank you Brian. I'll give it a go.