Dynamically setting worksheet tab colors

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
 
D

Don Guillett

Sub colortabbasedoncellvalue()
Sheets("Sheet22").Tab.ColorIndex = _
Sheets("sheet25").Range("d3").Interior.ColorIndex
End Sub
 
J

John

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)
 
J

John

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
 

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