Okay. Here's a loop of code that does exactly what you initially asked for, but a bit slowly:
Sub Foo()
Dim lRow As Long, lCol As Long, lColMax As Long
Application.ScreenUpdating = False
With Sheet1
lColMax = .Cells(2, Columns.Count).End(xlToLeft).Column
For lRow = .Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1
For lCol = lColMax - 3 To 9 Step -4
.Cells(lRow, lCol).Resize(1, 4).Cut .Cells(1, 5).End(xlDown).Offset(1, 0)
Next lCol
If lRow > 2 Then .Cells(lRow, 5).Resize((lColMax - 8) / 4, 1).EntireRow.Insert
Next lRow
.Range(Cells(1, 9), Cells(1, lColMax)).Clear
End With
Application.ScreenUpdating = True
End Sub
Now here's another better solution, which works much faster, and includes data in A:D:
Sub Bar()
Dim lRows As Long, lCol As Long, lColMax As Long
Application.ScreenUpdating = False
With Sheet1
lColMax = .Cells(2, Columns.Count).End(xlToLeft).Column
lRows = .Cells(Rows.Count, 1).End(xlUp).Row - 1
For lCol = lColMax - 3 To 9 Step -4
.Cells(2, 1).Resize(lRows, 4).Copy .Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
.Cells(2, lCol).Resize(lRows, 4).Cut .Cells(Rows.Count, 5).End(xlUp).Offset(1, 0)
Next lCol
.Range(Cells(1, 9), Cells(1, lColMax)).Clear
End With
Application.ScreenUpdating = True
End Sub
Bookmarks