If on the off chance you wanted a single delimited list then you could use a User Defined Function, eg:
Function GetCodes(rngText As Range, Optional strDelim As String = " ") As String
Const cDelim = "C:\"
Dim vData, vCodes, lngR As Long, lngC As Long, lngCode As Long
If rngText.Cells.Count = 1 Then
ReDim vData(1 To 1, 1 To 1)
vData(1, 1) = rngText.Value
Else
vData = rngText.Value
End If
For lngC = LBound(vData, 2) To UBound(vData, 2) Step 1
For lngR = LBound(vData, 1) To UBound(vData, 1) Step 1
vCodes = Split(Application.Trim(vData(lngR, lngC)), cDelim)
For lngCode = LBound(vCodes) To UBound(vCodes) - 1 Step 1
GetCodes = GetCodes & strDelim & Right(vCodes(lngCode), 3)
Next lngCode
Next lngR
Next lngC
GetCodes = Replace(GetCodes, strDelim, "", 1, 1)
End Function
the above, stored in a standard module, would be called from a cell along the lines of:
where A1 holds the string - the range you pass can encompass multiple cells (though it is assumed any multi cell range would be contiguous)
Bookmarks