Luis
Luis

Reputation: 139

Highlight Entire row if any changes occur in Range("M7:Q500") or ("C7:C500") Excel VBA

I have set up a code but I know it's completely wrong. My goal is to highlight entire row if a change is made in ("M7:Q500") or ("C7:C500") and highlight row based on where the change was made. Ex Cell M7 (Changed) Highlight entire 7 row

If Not Intersect(Target, Range("M7:Q500") Or ("C7:C500")) Is Nothing Then
    Cell.Interior.ColorIndex = 3
End If

Upvotes: 1

Views: 87

Answers (1)

Scott Craner
Scott Craner

Reputation: 152605

The Or part is wrong. Try this:

If Not Intersect(Target, Range("M7:Q500")) Is Nothing Or _
  Not Intersect(Target, Range("C7:C500")) Is Nothing Then
    Rows(Target.Row).Interior.ColorIndex = 3
End If

Upvotes: 3

Related Questions