Excel VBA in Excel 2002 - help!

Joined
Sep 4, 2008
Messages
3
Reaction score
0
What I need is a piece of code which will insert a specified number of rows below the current row within a spreadsheet.

I seem able to find code which will shift the current row down by a specified number of rows i.e inserting rows before my current point in the spreadsheet but nothing that answers my query! I'm really starting to get frustrated with this as everything else is working :wall:

Any suggestions? I would be greatful for any help!

Sian
 
Joined
Sep 3, 2008
Messages
164
Reaction score
5
Try this, it will add one row below the selected cell. To add more rows you can run it in a loop or introduce a variable.

Dim iR
Dim iC
iR = ActiveCell.Row
iC = ActiveCell.Column
Range(Cells(iR + 1, iC), Cells(iR + 1, iC)).Select
Selection.EntireRow.Insert Shift:=xlDown
 

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