 # Get First letter from each word

• Hey Guys
I have wrote a formula to grab the first letter from the first three words of a cell.
Only prob I have is I need it for the first four or five (five preferably)

Does anyone have one of these formulas, I know they would be extremely long to write.
Here is the one I have wrote:
[INDENT]=((LEFT(A2,1)&IF(ISERROR(FIND(" ",A2)),"",LEFT(MID(A2,FIND(" ",A2)+1,LEN(A2)),1))&IF(ISERROR(FIND(" ",MID(A2,FIND(" ",A2)+1,LEN(A2)))+FIND(" ",A2)),"",LEFT(MID(A2,FIND(" ",MID(A2,FIND(" ",A2)+1,LEN(A2)))+FIND(" ",A2)+1,1))))

[/INDENT]
Thanks a mill
RA

• Re: Get First letter from each word

Hi RA

A custom function will probably be a little more fexible than a formula as the formula will probably be longer the longer the word count. There is a nice bit of code on the extend office website here;

http://www.extendoffice.com/do…-letter-of-each-word.html

Looks a bit like this and seems to go OK.

Used like this

=GetFirstLetters(A2) where A2 contains your words.

Take care

Smallman

• Re: Get First letter from each word

Probably easiest to use a UDF

Then in B2:

=FirstLet(A2)

This will work for any number of words.

We now have a reputation system in place. If my reply helped please "Like" the reply by clicking the "Like" icon at bottom right of my reply.

• Re: Get First letter from each word

One more:

Code
1. Function Acronym(Words As Variant) As String
2. Dim aWord() As String, ix As Integer
3. aWord = Split(Words.Value, " ")
4. For ix = 0 To UBound(aWord)
5. Acronym = Acronym & UCase(Left(aWord(ix), 1))
6. Next ix
7. End Function

• [USER="33159"]KjBox[/USER] Thank you so much.. I spent about 8 hours and a hundred macros trying to do this

• You're welcome

We now have a reputation system in place. If my reply helped please "Like" the reply by clicking the "Like" icon at bottom right of my reply.