Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 93
Default Acronym Function?

Is there anyway to generate an acronym on cell contents with a function?

Ideally I could ignore certain words e.g. of, the, and, etc. and then for
the first letter of each word generate an acronym e.g.

United States of America = USA
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Acronym Function?

Hi,

Try this UDF which extracts the first capital of each word

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

--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"msnyc07" wrote:

Is there anyway to generate an acronym on cell contents with a function?

Ideally I could ignore certain words e.g. of, the, and, etc. and then for
the first letter of each word generate an acronym e.g.

United States of America = USA

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 93
Default Acronym Function?

Awesome, thanks so much!

"Mike H" wrote:

Hi,

Try this UDF which extracts the first capital of each word

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

--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"msnyc07" wrote:

Is there anyway to generate an acronym on cell contents with a function?

Ideally I could ignore certain words e.g. of, the, and, etc. and then for
the first letter of each word generate an acronym e.g.

United States of America = USA

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create Acronym (Extract first letter of each word) VB_Sam Excel Worksheet Functions 20 April 24th 23 09:05 PM
ACRONYM OF CAPS ONLY FARAZ QURESHI Excel Discussion (Misc queries) 3 February 23rd 09 09:58 AM
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) [email protected] Excel Worksheet Functions 0 September 5th 06 03:44 PM
How do I count a named range for a specific word or acronym? brandyb Excel Worksheet Functions 1 November 4th 05 07:50 PM
Emulate Index/Match combo function w/ VBA custom function Spencer Hutton Excel Worksheet Functions 2 May 2nd 05 05:26 PM


All times are GMT +1. The time now is 01:21 PM.

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

About Us

"It's about Microsoft Excel"