Here's your file. try again (I hope everything will turn out now
)
Sub ertert()
Dim x, y(), i&, j&, t()
With Sheets("In Flight Projects")
x = .Range("B8:D" & .Cells(Rows.Count, 2).End(xlUp).Row).Value
End With
With Sheets("Desired Outcome")
.Range("B8:C" & .Cells(Rows.Count, 2).End(xlUp).Row + 1).ClearContents
End With
ReDim y(1 To UBound(x), 1 To 2)
With CreateObject("Scripting.Dictionary")
.CompareMode = 1
For i = 1 To UBound(x)
If Not .Exists(x(i, 3)) Then
j = j + 1
.Item(x(i, 3)) = Array(j, "~" & x(i, 1) & "~")
y(j, 1) = x(i, 3)
y(j, 2) = 1
Else
t() = .Item(x(i, 3))
If InStr(t(1), "~" & x(i, 1) & "~") = 0 Then
t(1) = t(1) & x(i, 1) & "~"
y(t(0), 2) = y(t(0), 2) + 1
.Item(x(i, 3)) = t()
End If
End If
Next i
Sheets("Desired Outcome").Range("B8:C8").Resize(j) = y()
Sheets("Desired Outcome").Activate
End With
End Sub
Bookmarks