## isnumeric for characters?? ##

rudders

New Member
Joined
Oct 13, 2005
Messages
23
Hi all

is there a function in VBE to check if an input is a character? (i.e a-z or A-Z)...
I can use isnumeric to check numbers, but i wondered if there is a way to do this for characters?

cheers
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
no but you can do this:
Sub a()
X = InputBox("Enter One Character to Test")
If Asc(X) > 31 And Asc(X) < 65 Then MsgBox "It's nonnumeric and nonalphabetic."
End Sub

EDIT:
This does not capture ALL nonnumeric and nonalphabetic characters, the ascii codes here:
http://www.lookuptables.com
 
Upvote 0
sorry andrew,

how could i use your method if i have

X = inputbox ("enter a character")

?? where do i put the LIKE function??
 
Upvote 0
rudders said:
sorry andrew,

how could i use your method if i have

X = inputbox ("enter a character")

?? where do i put the LIKE function??

Like this:

Code:
If X Like "[A-Z]" Then
' OK
Else
' Not Ok
End If

Don't forget Option Compare Text at the top of your module.
 
Upvote 0

Forum statistics

Threads
1,202,990
Messages
6,052,961
Members
444,621
Latest member
MIKOLAJ_R

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top