programmatically insert multiple blank rows in worksheet

  • Thread starter Thread starter tag
  • Start date Start date
T

tag

This is the code to insert a blank row after each row of
data in my worksheet. I need to convert it to inserting 7
blank rows afer each row of data. So far...no luck.
Can anyone assist?
Thanks in advance!!

Sub Insert_Blank_Rows()

'Select last row in worksheet.
Selection.End(x1Down).Select

Do Until ActiveCell.Row = 1
'Insert blank row.
ActiveCell.EntireRow.Insert shift:=x1Down
'Move up one row.
ActiveCell.Offset(-1, 0).Select
Loop

End Sub
 
Try changing the following line of code:

ActiveCell.EntireRow.Insert shift:=x1Down

to

ActiveCell.Resize(7).EntireRow.Insert shift:=x1Down

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *
 
and change x(one)down to x(ell)down.


Rob said:
Try changing the following line of code:

ActiveCell.EntireRow.Insert shift:=x1Down

to

ActiveCell.Resize(7).EntireRow.Insert shift:=x1Down

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *
 
Dave Peterson said:
and change x(one)down to x(ell)down.

LOL! Yeah, that would help, wouldn't it? <g>

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *
 
Back
Top