Ok for fun.
- all data is in column B and starts at row 1
- a data block consists of four rows
- row 4 (Number) is deleted, row 3 (names) is moved to column C on event row, and row 2 (Date) is moved to column A on event row
If yes, try
Public Sub FormatWebData()
'#
'# declare private variables
'#
Dim pvt_lng_RowNumber As Long
'#
'# loop through all rows on the worksheet in reverse order - the parent rows
'# are considered to be at row 1, 5, 9 etc - the data blocks consist of four rows - the
'# row number within the group determines the action
'#
With ThisWorkbook.Worksheets("Sheet1")
For pvt_lng_RowNumber = .Cells(.Rows.Count, "B").End(xlUp).Row To 1 Step -1
Select Case pvt_lng_RowNumber Mod 4
Case 3
.Cells(pvt_lng_RowNumber - 2, "C").Value = .Cells(pvt_lng_RowNumber, "B").Value
.Rows(pvt_lng_RowNumber).Delete
Case 2
.Cells(pvt_lng_RowNumber - 1, "A").Value = .Cells(pvt_lng_RowNumber, "B").Value
.Rows(pvt_lng_RowNumber).Delete
Case 0
.Rows(pvt_lng_RowNumber).Delete
End Select
Next pvt_lng_RowNumber
End With
End Sub
Bookmarks