array in formula

E

ecoswiss

I want to do a formula where if say:
value = can be any thing of length 1 for example A, B, C, 2, !
I want to filter that
if value is an alphabet (A-Z) then populate that
else if value is something else then populate with 0

How do i do this in vbscript? is there a function? or do i have to do
multiple if else statments? for all alphabets?

Thanks,
Swiss
 
R

Rick Rothstein

VBScript is not the same thing as the VBA built into Excel. Assuming you
meant the VBA built into Excel, you can use the Len function to test the
length of a text value and you can use the like operator to test the type of
characters. Since you didn't post more information, here is some generalized
checking code...

If Len(YourTextValue) = 1 Then
If YourTextValue Like "[A-Za-z]" Then
'
' The value in YourTextValue is a single alphabetical
' character, so do whatever you need to with it here
'
End If
End If
 
Top