Tab color change

T

Thiago

I have a tab which is named "BALANCE", on this worksheet I have the balance
on cell A3. If the cell A3 is less or equal to 0 it will show red and if is
greater than 0 it will show green.
Now i want that the same color that is on A3 to be in the TAB is there a way
to automatically change the tab color as you input the number and A3 changes.
 
G

Gary''s Student

Assuming that the value in A3 is calculated, enter this worksheet event macro
in the worksheet code area:

Private Sub Worksheet_Calculate()
If Range("A3").Value <= 0 Then
Sheets("BALANCE").Tab.ColorIndex = 3
Else
Sheets("BALANCE").Tab.ColorIndex = -4142
End If
End Sub
 

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