Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Insert blank row after every 11th row.

I've found some vb code that kind of does what I need, but every time
I tweak the code to have it insert the blank row after each 11th row
it doesn't work. Any ideas?

Row 1 | Column Header
Row 2 | Value 1
Row 3 | Value 2
Row 4 | Value 3
Row 5 | Value 4
Row 6 | Value 5
Row 7 | Value 6
Row 8 | Value 7
Row 9 | Value 8
Row 10 | Value 9
Row 11 | Value 10
Row 12 | Value 11
Row 12 | BLANK ROW
Row 13 | Value 12...and so on and so forth.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Insert blank row after every 11th row.

Here's what I found originally:

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

Then there was a post saying to change x(one)down to x(ell)down. I
did that, but I wasn't able to figure out how to tell it to do this
every 11th row. I changed the 1's to 11's, but that didn't work. I
keep getting an application-defined or object-defined error.


On Mar 29, 10:11 am, "Don Guillett" wrote:
Post it

--
Don Guillett
SalesAid Software
"Captain Snuggles" wrote in message

ups.com...

I've found some vb code that kind of does what I need, but every time
I tweak the code to have it insert the blank row after each 11th row
it doesn't work. Any ideas?


Row 1 | Column Header
Row 2 | Value 1
Row 3 | Value 2
Row 4 | Value 3
Row 5 | Value 4
Row 6 | Value 5
Row 7 | Value 6
Row 8 | Value 7
Row 9 | Value 8
Row 10 | Value 9
Row 11 | Value 10
Row 12 | Value 11
Row 12 | BLANK ROW
Row 13 | Value 12...and so on and so forth.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Insert blank row after every 11th row.

Work from the bottom up

Sub insertrowat()
rowstoinsert = 3
lr = Cells(Rows.Count, "a").End(xlUp).Row
For i = lr To rowstoinsert + 1 Step -rowstoinsert
Rows(i).Insert
Next i
End Sub

--
Don Guillett
SalesAid Software

"Captain Snuggles" wrote in message
ups.com...
Here's what I found originally:

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

Then there was a post saying to change x(one)down to x(ell)down. I
did that, but I wasn't able to figure out how to tell it to do this
every 11th row. I changed the 1's to 11's, but that didn't work. I
keep getting an application-defined or object-defined error.


On Mar 29, 10:11 am, "Don Guillett" wrote:
Post it

--
Don Guillett
SalesAid Software
"Captain Snuggles"
wrote in message

ups.com...

I've found some vb code that kind of does what I need, but every time
I tweak the code to have it insert the blank row after each 11th row
it doesn't work. Any ideas?


Row 1 | Column Header
Row 2 | Value 1
Row 3 | Value 2
Row 4 | Value 3
Row 5 | Value 4
Row 6 | Value 5
Row 7 | Value 6
Row 8 | Value 7
Row 9 | Value 8
Row 10 | Value 9
Row 11 | Value 10
Row 12 | Value 11
Row 12 | BLANK ROW
Row 13 | Value 12...and so on and so forth.





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Insert blank row after every 11th row.

If I work from the bottom up it doesn't work right. How do I make it
go from top down?

On Mar 29, 11:04 am, "Don Guillett" wrote:
Work from the bottom up

Sub insertrowat()
rowstoinsert = 3
lr = Cells(Rows.Count, "a").End(xlUp).Row
For i = lr To rowstoinsert + 1 Step -rowstoinsert
Rows(i).Insert
Next i
End Sub

--
Don Guillett
SalesAid Software
"Captain Snuggles" wrote in message

ups.com...

Here's what I found originally:


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


Then there was a post saying to change x(one)down to x(ell)down. I
did that, but I wasn't able to figure out how to tell it to do this
every 11th row. I changed the 1's to 11's, but that didn't work. I
keep getting an application-defined or object-defined error.


On Mar 29, 10:11 am, "Don Guillett" wrote:
Post it


--
Don Guillett
SalesAid Software
"Captain Snuggles"
wrote in message


roups.com...


I've found some vb code that kind of does what I need, but every time
I tweak the code to have it insert the blank row after each 11th row
it doesn't work. Any ideas?


Row 1 | Column Header
Row 2 | Value 1
Row 3 | Value 2
Row 4 | Value 3
Row 5 | Value 4
Row 6 | Value 5
Row 7 | Value 6
Row 8 | Value 7
Row 9 | Value 8
Row 10 | Value 9
Row 11 | Value 10
Row 12 | Value 11
Row 12 | BLANK ROW
Row 13 | Value 12...and so on and so forth.





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Insert blank row after every 11th row.

try it this way

Sub insertrow()
nr = 5
i = nr
Do While Cells(i, "a") < ""
Cells(i, "a").EntireRow.Insert
i = i + nr
Loop
End Sub

--
Don Guillett
SalesAid Software

"Captain Snuggles" wrote in message
ups.com...
If I work from the bottom up it doesn't work right. How do I make it
go from top down?

On Mar 29, 11:04 am, "Don Guillett" wrote:
Work from the bottom up

Sub insertrowat()
rowstoinsert = 3
lr = Cells(Rows.Count, "a").End(xlUp).Row
For i = lr To rowstoinsert + 1 Step -rowstoinsert
Rows(i).Insert
Next i
End Sub

--
Don Guillett
SalesAid Software
"Captain Snuggles"
wrote in message

ups.com...

Here's what I found originally:


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


Then there was a post saying to change x(one)down to x(ell)down. I
did that, but I wasn't able to figure out how to tell it to do this
every 11th row. I changed the 1's to 11's, but that didn't work. I
keep getting an application-defined or object-defined error.


On Mar 29, 10:11 am, "Don Guillett" wrote:
Post it


--
Don Guillett
SalesAid Software
"Captain Snuggles"

wrote in message


roups.com...


I've found some vb code that kind of does what I need, but every
time
I tweak the code to have it insert the blank row after each 11th row
it doesn't work. Any ideas?


Row 1 | Column Header
Row 2 | Value 1
Row 3 | Value 2
Row 4 | Value 3
Row 5 | Value 4
Row 6 | Value 5
Row 7 | Value 6
Row 8 | Value 7
Row 9 | Value 8
Row 10 | Value 9
Row 11 | Value 10
Row 12 | Value 11
Row 12 | BLANK ROW
Row 13 | Value 12...and so on and so forth.





  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Insert blank row after every 11th row.

this is primitive but it should do what you want:

Sub ElevRowBlnk()
Range("$A$12").Activate
Do Until ActiveCell = ""
ActiveCell.EntireRow.Insert
ActiveCell.Offset(12, 0).Activate
Loop
End Sub

"Captain Snuggles" wrote:

If I work from the bottom up it doesn't work right. How do I make it
go from top down?

On Mar 29, 11:04 am, "Don Guillett" wrote:
Work from the bottom up

Sub insertrowat()
rowstoinsert = 3
lr = Cells(Rows.Count, "a").End(xlUp).Row
For i = lr To rowstoinsert + 1 Step -rowstoinsert
Rows(i).Insert
Next i
End Sub

--
Don Guillett
SalesAid Software
"Captain Snuggles" wrote in message

ups.com...

Here's what I found originally:


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


Then there was a post saying to change x(one)down to x(ell)down. I
did that, but I wasn't able to figure out how to tell it to do this
every 11th row. I changed the 1's to 11's, but that didn't work. I
keep getting an application-defined or object-defined error.


On Mar 29, 10:11 am, "Don Guillett" wrote:
Post it


--
Don Guillett
SalesAid Software
"Captain Snuggles"
wrote in message


roups.com...


I've found some vb code that kind of does what I need, but every time
I tweak the code to have it insert the blank row after each 11th row
it doesn't work. Any ideas?


Row 1 | Column Header
Row 2 | Value 1
Row 3 | Value 2
Row 4 | Value 3
Row 5 | Value 4
Row 6 | Value 5
Row 7 | Value 6
Row 8 | Value 7
Row 9 | Value 8
Row 10 | Value 9
Row 11 | Value 10
Row 12 | Value 11
Row 12 | BLANK ROW
Row 13 | Value 12...and so on and so forth.




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
Comment in every 11th row Radhakant Panigrahi Excel Discussion (Misc queries) 2 May 7th 10 05:58 AM
How can I insert a true blank inst. of a non-blank zero string MF Excel Worksheet Functions 2 October 30th 09 01:58 PM
Macro to insert copy and insert formulas only to next blank row bob Excel Programming 0 June 30th 06 12:02 PM
Macro code to test for blank row and insert blank row if false Mattie Excel Programming 2 March 29th 06 01:19 AM
macro stops copying sheets into a book after the 11th sheet MISMitch Excel Programming 1 October 22nd 03 05:27 PM


All times are GMT +1. The time now is 11:29 AM.

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

About Us

"It's about Microsoft Excel"