View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.newusers
Max Max is offline
external usenet poster
 
Posts: 9,221
Default in excel how to get initial from name

One way is to install & use the
UDF FrstLtrs below by Ron Rosenfeld (slightly adapted) ..
(UDF = user defined function)

To install the UDF:
Press Alt+F11 to go to VBE
Copy n paste the UDF into the code window (whitespace on right)
Press Alt+Q to get back to Excel

In Excel,
Assuming your data in A1 down,
put in B1: =frstltrs(A1)
copy down to extract the desired results

'--------
Function FrstLtrs(str As String) As String
Dim temp
Dim i As Long

temp = Split(Trim(str))

For i = 0 To UBound(temp)
FrstLtrs = FrstLtrs & Left(temp(i), 1) & "."
Next i

End Function
'-------

--
Max
Singapore
http://savefile.com/projects/236895
Downloads:22,000 Files:370 Subscribers:66
xdemechanik
---
"thyagu" wrote:
Hi, I want Initials of name in excel. Like in A1, I have
1) Lloyd L. Summers
2) Lloyd L Summers
I want L.L.S. in B1. Can I do that. Is there any formula?