Code:Public Sub ProcessData()Dim Lastrow As Long Dim Lastcol As Long Dim i As Long Application.ScreenUpdating = False With ActiveSheet Lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row For i = Lastrow To 3 Step -1 If .Cells(i, "A").Value2 = .Cells(i - 1, "A").Value2 Then Lastcol = .Cells(i - 1, .Columns.Count).End(xlToLeft).Column .Cells(i, "B").Resize(, 100).Copy .Cells(i - 1, Lastcol + 1) .Rows(i).Delete End If Next i End With Application.ScreenUpdating = True End Sub
Bookmarks