#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default ACRONYM OF CAPS ONLY

On Mon, 23 Feb 2009 00:08:03 -0800, FARAZ QURESHI
wrote:

I want 2 develop a UDF like Acro, which would return the acronymn of only the
letter in Caps. For example
=ACRO(A1)
when A1 is:
"United States of America"
would return:
USA
and NOT:
USOA



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 =ACRO(A1) in some
cell.



================================
Option Explicit
Option Compare Binary
Function ACRO(str As String) As String
Dim i As Long
Dim sTemp As String

For i = 1 To Len(str)
sTemp = Mid(str, i, 1)
If sTemp Like "[A-Z]" Then
ACRO = ACRO & sTemp
End If
Next i

End Function
=========================
--ron
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
fix all caps text to first letter caps MBartine Excel Discussion (Misc queries) 1 August 8th 06 03:02 AM
How do I count a named range for a specific word or acronym? brandyb Excel Worksheet Functions 1 November 4th 05 07:50 PM
How can I convert all Caps to first letter caps in Excel? Fenljp26 Excel Worksheet Functions 5 June 30th 05 11:35 AM
excel sheet all caps and needs to be only the first letter caps.. kroberts Excel Discussion (Misc queries) 1 March 7th 05 02:44 PM


All times are GMT +1. The time now is 05:06 AM.

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

About Us

"It's about Microsoft Excel"