I have a worksheet where I want a message box to appear when the letter "A" appears in the range I37:I69. I used to following code to accomplish this:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Range("I37:I69").Find(what:="AA", LookIn:=xlValues, lookat:=xlWhole, MatchCase:=True) Is Nothing Then
MsgBox "Exact dimensions needed for ceramic pipe due to required shop fabrication. This can affect both pipe costs and leadtime."
End If
End Sub
The problem is that the message box appear when ANY cell is changed, not just when the letter "A" appears in I37:I69.
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Range("I37:I69").Find(what:="AA", LookIn:=xlValues, lookat:=xlWhole, MatchCase:=True) Is Nothing Then
MsgBox "Exact dimensions needed for ceramic pipe due to required shop fabrication. This can affect both pipe costs and leadtime."
End If
End Sub
The problem is that the message box appear when ANY cell is changed, not just when the letter "A" appears in I37:I69.