Data is being pulled from SHEET2 and transposed and joined on SHEET1.
Problem:
Problem:
- It is not pulling all the data on SHEET1 because Column D Person has too many items.
- There are 12 persons and it is not pulling for all 12 people.
- It seems to only pull up to 11 items maximum per Person instead of the full count of 30+ rows.
VBA Code:
VBA Code:
Sub ReArrange()
Dim a As Variant, b As Variant, cr As Variant
Dim d As Object
Dim i As Long, lr As Long
Set d = CreateObject("Scripting.Dictionary")
d.CompareMode = 1
With Sheets("Sheet2")
lr = .Range("B" & Rows.Count).End(xlUp).Row
a = Application.Index(.Cells, Evaluate("row(2:" & lr & ")"), Array(5,2,4,3))
End With
ReDim b(1 To UBound(a), 1 To UBound(a))
For i = 1 To UBound(a)
If Not d.exists(a(i, 3)) Then d(a(i, 3)) = d.Count + 1 & " 1"
cr = Split(d(a(i, 3)))
b(cr(1), cr(0)) = Join(Application.Index(a, i, Array(2, 3, 4)), vbLf)
d(a(i, 3)) = cr(0) & " " & cr(1) + 1
Next i
With Sheets("Sheet2")
With .Range("A2").Resize(UBound(a), d.Count)
.WrapText = True
.Value = b
.Rows(0).Value = d.Keys