ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Tab color change (https://www.excelbanter.com/excel-discussion-misc-queries/201987-tab-color-change.html)

Thiago

Tab color change
 
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.

Don Guillett

Tab color change
 
See ans in your previous post about an hour ago

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Thiago" wrote in message
...
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.



Gary''s Student

Tab color change
 
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
--
Gary''s Student - gsnu200803


"Thiago" wrote:

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.



All times are GMT +1. The time now is 01:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com