ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   array in formula (https://www.excelbanter.com/excel-programming/416562-array-formula.html)

[email protected]

array in formula
 
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

Rick Rothstein

array in formula
 
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

--
Rick (MVP - Excel)


wrote in message
...
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




All times are GMT +1. The time now is 03:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com