Results with file sorted and check for duplicates.
Sub Transform()
Dim vSet As String
Dim vChar As String
Dim vProp As String
Dim vShot As String
Dim VDuplicate As String
Dim r As Long
Dim rr As Long
rr = 2
r = 2
On Error GoTo nextr
Do While Cells(r, 1) <> ""
vShot = Cells(r, 1)
vSet = ""
vChar = ""
vProp = ""
VDuplicate = ""
Do While Cells(r, 1) = vShot
If VDuplicate = Cells(r, 1) & Cells(r, 2) & Cells(r, 3) Then GoTo nextr
If Cells(r, 3) = "SET" Then
vSet = vSet & Cells(r, 2) & ","
Else
If Cells(r, 3) = "Character" Then
vChar = vChar & Cells(r, 2) & ","
Else
vProp = vProp & Cells(r, 2) & ","
End If
End If
nextr:
VDuplicate = Cells(r, 1) & Cells(r, 2) & Cells(r, 3)
r = r + 1
Loop
If vSet <> "" Then vSet = Left(vSet, Len(vSet) - 1)
If vChar <> "" Then vChar = Left(vChar, Len(vChar) - 1)
If vProp <> "" Then vProp = Left(vProp, Len(vProp) - 1)
Cells(rr, 5) = vShot
Cells(rr, 6) = vSet
Cells(rr, 7) = vChar
Cells(rr, 8) = vProp
rr = rr + 1
Loop
End Sub
Bookmarks