Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
tag tag is offline
external usenet poster
 
Posts: 5
Default programmatically insert multiple blank rows in worksheet

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default programmatically insert multiple blank rows in worksheet

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 *


"tag" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default programmatically insert multiple blank rows in worksheet

and change x(one)down to x(ell)down.


Rob Bovey wrote:

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 *

"tag" wrote in message
...
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


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default programmatically insert multiple blank rows in worksheet

"Dave Peterson" wrote in message
...
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 *


"Dave Peterson" wrote in message
...
and change x(one)down to x(ell)down.


Rob Bovey wrote:

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 *

"tag" wrote in message
...
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


--

Dave Peterson



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Text to Rows and then Insert Blank Rows [email protected] Excel Discussion (Misc queries) 1 December 20th 08 04:23 PM
Need to insert blank rows Gaurav[_3_] Excel Worksheet Functions 2 June 26th 08 07:55 PM
Insert Multiple Blank Rows CJ Excel Discussion (Misc queries) 3 April 14th 08 10:51 PM
How do i insert blank rows between data that is thousands of rows paul.eatwell Excel Discussion (Misc queries) 5 April 14th 08 10:49 PM
How do I insert blank rows between rows in completed worksheet? bblue1978 Excel Discussion (Misc queries) 1 October 26th 06 07:02 PM


All times are GMT +1. The time now is 11:47 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"