Detect whether the first character in a selection is alphanumeric

Article contributed by Bill Coan

If Selection.Characters(1) Like "[a-zA-Z0-9]" Then MsgBox "Alphanumeric"
If Selection.Characters(1) Like "[!a-zA-Z0-9]" Then MsgBox "Nonalphanumeric"


Click to view Terms of Use page

Click to view Disclaimer page