Hi All,
I am using the following VBA to extract first letters from SKU list. All is fine except when couple of SKUs have matching starting letters, then I get duplicate results. Like say there are items like Chicken Crispy, Chicken Chilly then in both cases i get CC.
Is there a way that ONLY in such conflicing cases ,I get different results say like CCr and CCh instead of CC in both cases.
VBA that I m using is geiven below:
Function GetFirstLetters(rng As Range) As String
'Update 20140325
Dim arr
Dim I As Long
arr = VBA.Split(rng, " ")
If IsArray(arr) Then
For I = LBound(arr) To UBound(arr)
GetFirstLetters = GetFirstLetters & Left(arr(I), 1)
Next I
Else
GetFirstLetters = Left(arr, 1)
End If
End Function
I am using the following VBA to extract first letters from SKU list. All is fine except when couple of SKUs have matching starting letters, then I get duplicate results. Like say there are items like Chicken Crispy, Chicken Chilly then in both cases i get CC.
Is there a way that ONLY in such conflicing cases ,I get different results say like CCr and CCh instead of CC in both cases.
VBA that I m using is geiven below:
Function GetFirstLetters(rng As Range) As String
'Update 20140325
Dim arr
Dim I As Long
arr = VBA.Split(rng, " ")
If IsArray(arr) Then
For I = LBound(arr) To UBound(arr)
GetFirstLetters = GetFirstLetters & Left(arr(I), 1)
Next I
Else
GetFirstLetters = Left(arr, 1)
End If
End Function