Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Dim i As Long, str As String
If Target.Address = "$A$1" Then
str = Range(Target.Address)
If IsNumeric(str) Then
If Val(str) < 0 Or Val(str) > 100 Then GoTo Wrong
End If
If Not IsNumeric(str) Then
If str <> "x" And str <> "X" Then GoTo Wrong
End If
End If
Application.EnableEvents = True
Exit Sub
Wrong:
MsgBox "Only allowed 0-100 or x"
Range(Target.Address) = ""
Range(Target.Address).Select
Application.EnableEvents = True
End Sub