Make a macro loop

P

Paula Tanabe

I would like t create a simple macro that would insert a line every 10 lines in a excel speadsheet that has 500 lines it. Does anyone have any suggestions?
 
T

Tushar Mehta

Depending on your defintion of "every 10 lines", you might have to
adjust the loop control variables in the code below:

Sub testIt2()
Dim i As Long
For i = 500 To 1 Step -10
ActiveSheet.Rows(i).Insert
Next i
End Sub

--
Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
 

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

Top