I have a code that looks up 2 different cells and displays a pop up every time both cells have certain criteria, however it only does it for that specific row.
I'm looking for a way to have 1 code that will look up every pair of cells on each row and evaluate them independently.
Tried changing the ranges but obviously that creates a long code, I'm sure there is a better way but my knowledge is limited.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Not Application.Intersect(Target, Me.Range("A:B")) Is Nothing Then
If (Range("A2").Value = "Text1") And Range("B2").Value > ### Then MsgBox "Message"
End If
End Sub
The code should look at the entire table of 200 rows and ideally keep looking if the table grows larger for specific criteria on each row, all A2
and B2
, A3
and B3
and so on.
Currently it only looks at the cells I selected and the only solution I can think of is to copy paste and change the ranges on each new piece of the code.
Thank you!