Greetings, all!
I am trying to find a way to prevent employees from incorrectly typing in their employee number. I can do it caveman-style by using:
If Cells(19, 4).Value <> 1000 Then
MsgBox prompt:="That employee # does not exist"
Exit Sub
End If
I would have to make a new "If" segment for every employee, though. If I could use "Or" (<> 1000 Or 1204 Or 5492, etc.) it would seem pretty straightforward. And since the employee numbers aren't in tight sequence I can't just use > 1000 and 5000 < as it would still allow for typing in an nonexistent employee number within that range.
Is there an easy way to add an array of acceptable numbers within a single If command?
Bookmarks