Hello,
I am running the code below in a worksheet but have to double click on the cell in order for it to run. Can this run automatically?
Private Sub Worksheet_Change(ByVal Target As Range)
MyVal = Range("A1").Text
With ActiveSheet.Tab
Select Case MyVal
Case "1"
.Color = vbRed
Case "0"
.ColorIndex = xlColorIndexNone
Case Else
.ColorIndex = xlColorIndexNone
End Select
End With
End Sub
I am running the code below in a worksheet but have to double click on the cell in order for it to run. Can this run automatically?
Private Sub Worksheet_Change(ByVal Target As Range)
MyVal = Range("A1").Text
With ActiveSheet.Tab
Select Case MyVal
Case "1"
.Color = vbRed
Case "0"
.ColorIndex = xlColorIndexNone
Case Else
.ColorIndex = xlColorIndexNone
End Select
End With
End Sub