Experimente
Sub OrganizaDados()
Dim N As Long, k As Long, c As Long, x As Long, m As Long, LR As Long
For N = 2 To Cells(Rows.Count, 2).End(xlUp).Row
k = Application.CountIf(Range("B" & N & ":B" & Cells(Rows.Count, 2).End(xlUp).Row), Cells(N, 2)): x = 7
c = Application.CountIf(Range(Cells(N, 3), Cells(N + k - 1, 3)), Cells(N, 3))
LR = Cells(Rows.Count, 7).End(xlUp).Row
Cells(LR + 1, x).Resize(, 5).Value = Cells(N, 1).Resize(, 5).Value: x = 12
For m = N + 1 To N + c - 1
Cells(LR + 1, x).Resize(, 2).Value = Cells(m, 4).Resize(, 2).Value: x = x + 2
Next m
N = N + c - 1
Next N
End Sub
Postado : 16/02/2016 9:05 pm