I understand that but what I am trying to do is highlight the next row. Say I hax an x in row 5, then row 6 will be highlighted. Then when I put an x in row 6 I want row 6 to no longer be highlighted and then row 7 to highlight. I created the event I just need to fix the actual macro. It is as follows (don't know if the firstAddress part does anything):
Event:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("F4:F200")) Is Nothing Then
Call autoHighlight
End If
End Sub
Macro:
Sub autoHighlight()
Dim rg As Range, c As Range
Dim firstAddress As String
Set rg = Range("F4", "F250")
Application.ScreenUpdating = False
With rg
Set c = .Find("x", lookat:=xlWhole, LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
c.EntireRow.Interior.ColorIndex = 6
Set c = .FindNext(c)
If c Is Nothing Then Exit Do
Loop While c.Address <> firstAddress
End If
Application.ScreenUpdating = True
End With
End Sub
Bookmarks