Distinguish vowels and consonants

Engenhus

New member
Local time
Today, 10:35
Joined
Dec 23, 2006
Messages
4
Hi. Suppose I have the string "PE23SA7". Is there a way to identify if the character in the x position is a vowel, a consonant, a number or something else?
 
You could create a table with all vowels and a table with all constanents. Then test to see if the value is in either table. Also you can use the IsNumeric function to test if it is a number.
 
Good idea. Thanks
 
You could also just make a function with VBA and hard code the vowels and constentaints. Because this is pretty static data.
 
just begging a select case function :)
Code:
Function TestType(TextIn)
Select Case TextIn
    Case 0 To 9
        TestType = "Number"
    Case "a", "e", "i", "o", "u"
        TestType = "Vowel"
    Case "b" To "z"
        TestType = "Consonant"
    Case Else
        TestType = "Other"
End Select
End Function

peter
 

Users who are viewing this thread

Back
Top Bottom