Dynamically setting worksheet tab colors

  • Thread starter Thread starter John
  • Start date Start date
J

John

How do I make the worksheet tab color be the same as the color of a cell in
another worksheet?

Thx for your help, John
 
Sub colortabbasedoncellvalue()
Sheets("Sheet22").Tab.ColorIndex = _
Sheets("sheet25").Range("d3").Interior.ColorIndex
End Sub
 
Looks good, but where do I put this routine?

Don Guillett said:
Sub colortabbasedoncellvalue()
Sheets("Sheet22").Tab.ColorIndex = _
Sheets("sheet25").Range("d3").Interior.ColorIndex
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(e-mail address removed)
 
Understand. And this works fine if I execute the macro after changing the
color of the cell. But I want the change to take place as soon as I change
the color of the cell.

Sooo, it seems to do what I wan if I place the VB routine you suggested in
the Sheet25(Sheet25) area with a header of Private Sub
Worksheet_SelectionChange(ByVal Target As Range), rather than in Module1.

Now whenever I navigate way from the cell after changing its color, the tab
on the corresponding sheet changes. Is there a better solution? I'm pretty
green in the VB world.

Thx for your help, John
 
Back
Top