Macro Looping

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top