Hello everyone
I have the data in three columns. The first column is for the IDs and this will be unique in output in column A in output
The second column would be the headers after the column A in output
The third column has the values which I need to populate properly in each suitable place in the output
The attachment will explain better than the description
Sub Test()
Dim a, d As Object, d2 As Object, s As String, i As Long, m As Long
Dim k As Long, c As Long
a = Range("A1:C" & Cells(Rows.Count, 1).End(xlUp).Row).Value
ReDim b(1 To UBound(a, 1), 1 To UBound(a, 1))
k = 1: c = 2: b(1, 1) = a(1, 1)
Set d = CreateObject("Scripting.Dictionary")
For i = 2 To UBound(a)
If Not d.Exists(a(i, 1)) Then
k = k + 1
b(k, 1) = a(i, 1)
d(a(i, 1)) = a(i, 2)
b(1, c) = a(i, 2)
b(k, c) = a(i, 3)
Else
c = c + 1
b(1, c) = a(i, 2)
b(k, c) = a(i, 3)
End If
Next i
'Range("E10").Resize(d.Count).Value = Application.Transpose(d.keys)
End Sub
Posted at this link too
http://www.eileenslounge.com/viewtopic.php?f=30&t=34512
Bookmarks