Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Name DOC STATUS
- John ID OK
- John ADRESS Incomplete
- John SURNAME Missing
- Lara ID OK
- Lara ADRESS Missing
- Lara SURNAME Missing
- Rony ID OK
- Rony ADRESS OK
- Rony SURNAME OK
- Option Explicit
- Sub GroupEveryNRows()
- Dim i As Long, LastRow As Long
- ' modify "Sheet1" to your sheet's name
- With Sheets("Sheet1")
- ' find last row with data in Column A
- LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
- ' loop from 2nd row till last row with data (assuming the first row has headers)
- For i = 2 To LastRow Step 3
- Range("A" & i + 1 & ":A" & i + 2).Rows.Group
- Next i
- End With
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement