Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Option Explicit
- Sub Macro1()
- 'Written by Trebor76
- 'Visit my website www.excelguru.net.au
- Dim lngMyRow As Long
- Dim lngLastRow As Long
- Dim rngMyRange As Range
- lngLastRow = Cells(Rows.Count, "A").End(xlUp).Row
- For lngMyRow = 201 To lngLastRow Step 201
- If lngMyRow <> 201 Then lngMyRow = lngMyRow - 1
- If rngMyRange Is Nothing Then
- Set rngMyRange = Cells(lngMyRow, "A")
- Else
- Set rngMyRange = Union(rngMyRange, Cells(lngMyRow, "A"))
- End If
- Next lngMyRow
- rngMyRange.EntireRow.Insert
- Application.ScreenUpdating = True
- MsgBox "Rows have now been inserted"
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement