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
 
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
 
Back
Top