Hello,
I am trying to figure a way to loop through a range in order to delete 2 rows using a range.offset (1,0).
Basically, the macro or code has to go down one cell and then delete 2 rows. This has to be repeated until the end of the range. The range is rows 2 to 63.
So, the code would delete the 2 rows (rows 3 and 4) below row2, then it would delete rows 6 and 7, then rows 9 and 10 .
I am pretty crappy at VBA but I want to learn how to do it. Any help would be greatly appreciated.
Here is what I have so far. I know how to declare a range and how to select the range to loop through, but I don't know how to write a loop script to delete the rows.
![]()
Sub GettingRid() Dim RangeToDelete As Range Range("2:63").Select Dim Xi As Long For Xi = 2 To (2 + 63) / 2 Rows(Xi).Delete Next Xi End Sub
Bookmarks