Macro Looping

P

Paula Tanabe

I would like to make a simple macro that will insert a row every 10 rows in my excel spreadsheet. I can not figure out how to do a command that show my cursor moving down the spreadsheet.
 
R

Ron de Bruin

Try this Paula

Sub test()
Application.ScreenUpdating = False
Dim numRows As Integer
Dim R As Long
Dim Rng As Range
numRows = 1
Set Rng = Range("a1:a200")
For R = Rng.Rows.Count To 1 Step -10
Rng.Rows(R + 1).Resize(numRows).EntireRow.insert
Next R
Application.ScreenUpdating = True
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)




Paula Tanabe said:
I would like to make a simple macro that will insert a row every 10 rows in my excel spreadsheet. I can not figure out how to
do a command that show my cursor moving down the spreadsheet.
 
Top