A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Removing Of/And/The from Acronym Function



 
 
Thread Tools Display Modes
  #1  
Old March 11th, 2010, 11:16 PM posted to microsoft.public.excel.worksheet.functions
msnyc07
external usenet poster
 
Posts: 97
Default Removing Of/And/The from Acronym Function

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.
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:30 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.