need to apply require me to use the first letter from the word followed by
the next consonant. I can seperate the first letter easily but I have no
idea
how to capture the following consonant.
You can do this easily with a User Defined Function.
To enter this User Defined Function (UDF), <alt-F11> opens the Visual
Basic
Editor.
Ensure your project is highlighted in the Project Explorer window.
Then, from the top menu, select Insert/Module and
paste the code below into the window that opens.
To use this User Defined Function (UDF), enter a formula like
=SpecCode(A1)
in some cell.
The Code returned is upper case, and the value returned is the first
Character,
and the next character that is not a vowel. I assumed all of your words
consisted of "letters" and that there were no digits, hyphens,
underscores, etc
to deal with. If that is not the case, the comparison can be expanded.
==================================
Option Explicit
Option Compare Text
Function SpecCode(str As String) As String
Dim sTemp As String
Dim i As Long
For i = 2 To Len(str)
sTemp = Mid(str, i, 1)
If Not sTemp Like "[aeiouy]" Then
SpecCode = UCase(Left(str, 1) & sTemp)
Exit Function
End If
Next i
SpecCode = "No Pattern Match"
End Function
=================================