Dear all
I am having the following code for popup message.
Code
Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim a As Range, rng As Range Dim counter As Long Set rng = Sheets("Data").Range("H30:H136") For Each a In rng If a >= 3 Then counter = counter + 1 a.Offset(0, -5).Interior.ColorIndex = 44 MsgBox "Aggregate value is crossed the tolerance limit." & vbNewLine & "Please check the value", vbInformation, "SSIPL Warning" ElseIf a <= -3 Then counter = counter + 1 a.Offset(0, -5).Interior.ColorIndex = 44 MsgBox "Aggregate value is crossed the tolerance limit." & vbNewLine & "Please check the value", vbInformation, "SSIPL Warning" ElseIf a <= 3 And a >= -3 Then counter = counter + 1 a.Offset(0, -5).Interior.ColorIndex = 0 End If Next a End sub
with this code the popup is displaying every time when i select any cells. But i want to display the message only I select the particular cell or row where the value is crossed the set limit.
Can any one please explain me how to do this