ashish koul
Member
If you want to concatenate the first letter of each word in a cell .For example -
Input Output
Johnson & Johnson J & J
Procter & Gamble P & G
Boston Consulting Group B C G
Try this udf
[pre]
[/pre]
Input Output
Johnson & Johnson J & J
Procter & Gamble P & G
Boston Consulting Group B C G
Try this udf
[pre]
Code:
Function con_1stletter(str1 As String)
Dim arr1, i As Integer, str2 As String
arr1 = Split(str1, " ")
str2 = ""
For i = LBound(arr1) To UBound(arr1)
str2 = str2 & Left(arr1(i), 1) & " "
Next
con_1stletter = Application.WorksheetFunction.Trim(str2)
End Function