Please try this.
![]()
Sub jw_test() Dim row_s As Long Dim row_e As Long Dim col_s As Long Dim i As Long row_s = 4 col_s = 9 With ActiveSheet Cells(row_s, col_s) = Cells(row_s, 1) For i = row_s To Cells(4, 1).End(xlDown).Row If Cells(i, 1) = Cells(i + 1, 1) Then col_s = col_s + 1 Else row_s = row_s + 1 col_s = 9 Cells(row_s, col_s) = Cells(i + 1, 1) i = i + 1 col_s = col_s + 1 End If Cells(row_s, col_s) = Cells(i, 3) Next End With End Sub good luck!
Bookmarks