.
Using this macro :

Option Explicit

Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Intersect(Target, Range("N25:N50")).Value = 0 Then
        MsgBox "This is a warning message", vbOKOnly & vbCritical, "Wrong Data Entry"
    End If
End Sub

How do you overcome the macro 'firing' after entering a value into a cell NOT in the specified range ?


Error Msg.jpg