M
msnyc07
Someone kindly provided me with:
Function FrstLtrs(MyStr As String) As String
Dim temp
Dim i As Long
TmpStr = Split(Trim(MyStr))
For i = 0 To UBound(TmpStr)
If Asc(Left(TmpStr(i), 1)) >= 65 And _
Asc(Left(TmpStr(i), 1)) <= 90 Then
FrstLtrs = FrstLtrs & Left(TmpStr(i), 1)
End If
Next
End Function
Which worked great but didn't ignore The/And/Of if capped. So I found some
code that should have worked
If Not (UCase(TmpStr) = "OF") And Not (UCase(TmpStr) = "FOR") And Not
(UCase(prom) = "THE") And _
Not (UCase(prom) = "AND") And Not (UCase(prom) = "A") And Not
(UCase(prom) = "ON") Then
and of course added another
End If
But I get value errors.
Any thoughts appreciated.
Function FrstLtrs(MyStr As String) As String
Dim temp
Dim i As Long
TmpStr = Split(Trim(MyStr))
For i = 0 To UBound(TmpStr)
If Asc(Left(TmpStr(i), 1)) >= 65 And _
Asc(Left(TmpStr(i), 1)) <= 90 Then
FrstLtrs = FrstLtrs & Left(TmpStr(i), 1)
End If
Next
End Function
Which worked great but didn't ignore The/And/Of if capped. So I found some
code that should have worked
If Not (UCase(TmpStr) = "OF") And Not (UCase(TmpStr) = "FOR") And Not
(UCase(prom) = "THE") And _
Not (UCase(prom) = "AND") And Not (UCase(prom) = "A") And Not
(UCase(prom) = "ON") Then
and of course added another
End If
But I get value errors.
Any thoughts appreciated.