Folks,
I have 5 sheets, name 1,2,3,4 and Summary what I want is :
if cell value in B6 (progress) is 0%, then tab color changing to Red
if cell value in B6 (progress) is greater than 0 but less than 100%, tab color change to Green. Else is Black.
That should happen only in sheets 1,2,3,4 but not for Summary.
Is there any code to do that ?
I tried to put the code in ThisWorkbook, and it won't work :
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("B6").Value = 0 Then
ActiveWorkbook.Sheets.Tab.Color = 255
ElseIf Range("B6").Value < 1 Then
ActiveWorkbook.Sheets.Tab.Color = 5287936
ElseIf Range("B6").Value = 1 Then
ActiveWorkbook.Sheets.Tab.Color = 0
Else
ActiveWorkbook.Sheets("test").Tab.ColorIndex = -4142
End If
End Sub
Please help me, thank you
I have 5 sheets, name 1,2,3,4 and Summary what I want is :
if cell value in B6 (progress) is 0%, then tab color changing to Red
if cell value in B6 (progress) is greater than 0 but less than 100%, tab color change to Green. Else is Black.
That should happen only in sheets 1,2,3,4 but not for Summary.
Is there any code to do that ?
I tried to put the code in ThisWorkbook, and it won't work :
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("B6").Value = 0 Then
ActiveWorkbook.Sheets.Tab.Color = 255
ElseIf Range("B6").Value < 1 Then
ActiveWorkbook.Sheets.Tab.Color = 5287936
ElseIf Range("B6").Value = 1 Then
ActiveWorkbook.Sheets.Tab.Color = 0
Else
ActiveWorkbook.Sheets("test").Tab.ColorIndex = -4142
End If
End Sub
Please help me, thank you