My primary data entry is a Worksheet named "Master". I want to check in Range A2:A1000 when a word is entered. If it is "CBI", "Fire", "InCase" or "LEA" nothing needs to happen in Column I (Offset(0, 8)) as it already has a no-fill (Interior.ColorIndex = -4142). But, if any other word is entered in Range A2:A1000, Column I (Offset(0, 8)) is changed to a different color (Interior.Color = RGB(255, 231, 255)). I have selected the discrete worksheet with "Worksheet" and "Change" but cannot get the Intersect to function. I know the code is repetitive ... I would like to use multiple arguments, e.g., "CBI", "Fire", "InCase", "LEA" ... but it crashes at the firstIf Target line. Alternatively, a Select Case argument might be better. I have reviewed stackoverflow results on my search "run vba when cell change" and attempted to modify without success. I have also tried several coding attempts in the lone module where I have my other Subs which run fine, but help with this would be appreciated.
Private Sub Worksheet_Change(ByVal Target As Range)
'Change interior color in Offset cell if certain words not entered in Range A2:A1000
If Not Intersect(Target, Range("A2:A1000")) Is Nothing Then
If Target(Range("A2:A1000"), "CBI") > 0 Then
ActiveCell.Offset(0, 8).Interior.ColorIndex = -4142
Else
If Target(Range("A2:A1000"), "Fire") > 0 Then
ActiveCell.Offset(0, 8).Interior.ColorIndex = -4142
Else
If Target(Range("A2:A1000"), "InCase") > 0 Then
ActiveCell.Offset(0, 8).Interior.ColorIndex = -4142
Else
If Target(Range("A2:A1000"), "LEA") > 0 Then
ActiveCell.Offset(0, 8).Interior.ColorIndex = -4142
Else
ActiveCell.Offset(0, 8).Interior.Color = RGB(255, 231, 255)
End If
End If
End Sub