I saw this on another post, but it needs some mod to work in my situation. Thanks for your help!
Sub test()
Dim ResultArray, _
SingleName As String, _
ColorVal As String, _
NamesToGet As String, _
ReadInString As String, _
RowCount As Long, _
TestRow As Long, _
NameCount As Long, _
Ctrl As Long, _
BarPos As Integer, _
LISTSHT As Worksheet, _
PARSED As Worksheet
Set LISTSHT = Sheets("Sheet1") 'original unprocessed sheet
Set PARSED = Sheets("parsed") ' sheet to hold code output
RowCount = LISTSHT.Cells(Rows.Count, "A").End(xlUp).Row
For TestRow = 1 To RowCount 'Step -1
ReadInString = LISTSHT.Range("A" & TestRow)
BarPos = InStr(1, ReadInString, "|")
ColorVal = Trim(Left(ReadInString, BarPos - 1))
NamesToGet = Mid(ReadInString, BarPos + 1)
ResultArray = Split(NamesToGet, ",")
If UBound(ResultArray) = -1 Then
NameCount = NameCount + 1
PARSED.Cells(NameCount, 1).Value = ColorVal
Else
For Ctrl = 0 To UBound(ResultArray)
NameCount = NameCount + 1
PARSED.Cells(NameCount, 1).Value = ColorVal
SingleName = Trim(ResultArray(Ctrl))
PARSED.Cells(NameCount, 2).Value = SingleName
Next Ctrl
End If
Next TestRow
End Sub
Bookmarks