Howdy,
I'm new to the board and new to VBA programming, but I think this should be a very simple questions. The code below works for row 5 of my sheet, but I would like it to work on every subsequent row in the sheet (for like 1000 rows). I assume I need a dim loop, but I can't get it to work. Thanks in advance for the help!
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If [B5] = "Startup" Then
[F5, I5:K5].Interior.ColorIndex = 3
Worksheets("Input Log").Range("F5, I5:K5").ClearContents
Else
[F5, I5:K5].Interior.ColorIndex = 0
End If
If [B5] = "Shutdown" Then
[D5:E5].Interior.ColorIndex = 3
Worksheets("Input Log").Range("D5:E5").ClearContents
Else
[D5:E5].Interior.ColorIndex = 0
End If
If [I5] = "Catalyst Malfunction" Or [I5] = "" Then
[M5].Interior.ColorIndex = 0
Else
[M5].Interior.ColorIndex = 3
Worksheets("Input Log").Range("M5").ClearContents
End If
Application.EnableEvents = True
End Sub
Bookmarks