How to collect first letters of the few words in excel ?

veer-india

New Member
Sorry, but this is slightly like this answer http://www.mrexcel.com/forum/excel-questions/656277-extracting-first-letter-each-word-cell.html ,, I am trying to find a vba script through which i can extract first letters of the first 5-6 words in excel ? How i can achieve this ?
for example "i am a big fat cow with very big body." it is in a cell, I want extract only first 5 letters or first 6 letters of each word which should be iaabfc - for 6 letters. Any correct formula ? only the first 5 or 6. Not the whole line. Thanks in advance.

Last edited:

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},\$Z\$1:\$Z\$99,\$Y\$1:\$Y\$99),2,False) to lookup Y values to left of Z values.
Here is a UDF (user defined function) that will return what you want, just pass it the text to parse and the number of "first letters" you want. So, if your text was in cell A1 and you want the first 6 "first letters" from it, you would use this formula in a cell...

=FirstLetters(A1,6)

Here is the function's code...
Code:
``````Function FirstLetters(S As String, N As Long) As String
Dim X As Long, Words() As String
Words = Split(S)
For X = 0 To N - 1
FirstLetters = FirstLetters & Left(Words(X), 1)
Next
End Function``````

Thanks that worked very well.

Replies
5
Views
917
Replies
9
Views
269
Replies
6
Views
199
Replies
11
Views
428
Replies
5
Views
856

1,203,563
Messages
6,056,092
Members
444,846
Latest member
pbailey

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back