Hello,Hello,
I am trying to write code that will allow only certain formats in a cell:
E.g.
I want to use a similar structure (Select Case) like above so that a cell only accepts one letter e.g. “A”, “B” or “C” otherwise it rejects the value entered.
Thanks in advance.
I am trying to write code that will allow only certain formats in a cell:
E.g.
Code:
Case [A1]
If 0 < Len(Target.Value) And (Len(Target.Value) > 2 Or IsNumeric(Target.Value) = False) Then
MsgBox "Value entered must be a 1 or 2 digits long number.", vbExclamation, "Incorrect Data!"
Target.Value = ""
End If
Thanks in advance.