split cell value

P

Pradeep

Hi,

I have a huge data contains names of the customer in a single column, i want
to take out the first letter of the first name in the word and add with a dot.

Example

If the name in the column A1 - Tiger Woods , i want the result in B2 as T.W.
Sachin R Tendulkar - S.R.T.
Adam Gilly Jr - A.G.Jr.
 
J

Jacob Skaria

Try this UDF (User Defined function). From workbook launch VBE using Alt+F11.
From menu Insert a Module and paste the below function.Close and get back to
workbook and try the below formula.

=getinitials(A1)

Function GetInitials(strData As String)
arrData = Split(strData, " ")
For intword = 0 To UBound(arrData)
If Len(arrData(intword)) > 2 Then
GetInitials = GetInitials & Left(arrData(intword), 1) & "."
Else
GetInitials = GetInitials & arrData(intword) & "."
End If
Next
End Function
 
R

Roger Govier

see response to your earlier posting where I gave you a macro to do this.

--
Regards
Roger Govier

Pradeep said:
Hi,

I have a huge data contains names of the customer in a single column, i
want
to take out the first letter of the first name in the word and add with a
dot.

Example

If the name in the column A1 - Tiger Woods , i want the result in B2 as
T.W.
Sachin R Tendulkar - S.R.T.
Adam Gilly Jr - A.G.Jr.
--
Thanks and all your help will be much appriciated

__________ Information from ESET Smart Security, version of virus
signature database 4828 (20100202) __________

The message was checked by ESET Smart Security.

http://www.eset.com

__________ Information from ESET Smart Security, version of virus signature database 4828 (20100202) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top