ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Inserting Blank rows between items (https://www.excelbanter.com/excel-discussion-misc-queries/190031-inserting-blank-rows-between-items.html)

JB

Inserting Blank rows between items
 
How can I quickly insert 3 blank rows between a list of many items? For
example, I have the following list of items in cells a1 thru a5 and I want to
quickly insert 3 blank rows between each item, without having to do each one
at a time:

John
James
Joe
Nancy
Steve

Thanks for the help.

Don Guillett

Inserting Blank rows between items
 
Sub insert3rows()
For i = Cells(Rows.Count, "a").End(xlUp).Row To 1 Step -1
Rows(i).Resize(3).Insert
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"JB" wrote in message
...
How can I quickly insert 3 blank rows between a list of many items? For
example, I have the following list of items in cells a1 thru a5 and I want
to
quickly insert 3 blank rows between each item, without having to do each
one
at a time:

John
James
Joe
Nancy
Steve

Thanks for the help.



JB

Inserting Blank rows between items
 
Yikes! I'm a bit of a novice here. What is this you just wrote? Is it a
macro?

"Don Guillett" wrote:

Sub insert3rows()
For i = Cells(Rows.Count, "a").End(xlUp).Row To 1 Step -1
Rows(i).Resize(3).Insert
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"JB" wrote in message
...
How can I quickly insert 3 blank rows between a list of many items? For
example, I have the following list of items in cells a1 thru a5 and I want
to
quickly insert 3 blank rows between each item, without having to do each
one
at a time:

John
James
Joe
Nancy
Steve

Thanks for the help.




JB

Inserting Blank rows between items
 
Disregard my last post. I tried this as a Macro and it worked perfectly.
Thanks Mr. Guillett!

"JB" wrote:

Yikes! I'm a bit of a novice here. What is this you just wrote? Is it a
macro?

"Don Guillett" wrote:

Sub insert3rows()
For i = Cells(Rows.Count, "a").End(xlUp).Row To 1 Step -1
Rows(i).Resize(3).Insert
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"JB" wrote in message
...
How can I quickly insert 3 blank rows between a list of many items? For
example, I have the following list of items in cells a1 thru a5 and I want
to
quickly insert 3 blank rows between each item, without having to do each
one
at a time:

John
James
Joe
Nancy
Steve

Thanks for the help.




Don Guillett

Inserting Blank rows between items
 
Glad to help
If you're new to macros, you may want to read David McRitchie's intro
at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"JB" wrote in message
...
Disregard my last post. I tried this as a Macro and it worked perfectly.
Thanks Mr. Guillett!

"JB" wrote:

Yikes! I'm a bit of a novice here. What is this you just wrote? Is it
a
macro?

"Don Guillett" wrote:

Sub insert3rows()
For i = Cells(Rows.Count, "a").End(xlUp).Row To 1 Step -1
Rows(i).Resize(3).Insert
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"JB" wrote in message
...
How can I quickly insert 3 blank rows between a list of many items?
For
example, I have the following list of items in cells a1 thru a5 and I
want
to
quickly insert 3 blank rows between each item, without having to do
each
one
at a time:

John
James
Joe
Nancy
Steve

Thanks for the help.




JB

Inserting Blank rows between items
 
Thanks Don. I'll do that. Here's another quick question: Every time I run
my new Macro you gave me, the Macro records what it's doing and changes
itself so that when I go to run it again, it adds 6 blank rows. How do I get
it to stop changing itself?

"Don Guillett" wrote:

Glad to help
If you're new to macros, you may want to read David McRitchie's intro
at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"JB" wrote in message
...
Disregard my last post. I tried this as a Macro and it worked perfectly.
Thanks Mr. Guillett!

"JB" wrote:

Yikes! I'm a bit of a novice here. What is this you just wrote? Is it
a
macro?

"Don Guillett" wrote:

Sub insert3rows()
For i = Cells(Rows.Count, "a").End(xlUp).Row To 1 Step -1
Rows(i).Resize(3).Insert
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"JB" wrote in message
...
How can I quickly insert 3 blank rows between a list of many items?
For
example, I have the following list of items in cells a1 thru a5 and I
want
to
quickly insert 3 blank rows between each item, without having to do
each
one
at a time:

John
James
Joe
Nancy
Steve

Thanks for the help.





Don Guillett

Inserting Blank rows between items
 

The macro is not/can not change itself. It is doing what was asked. It was
designed to run once to add the desired rows. If you are saying that you
want it to add blank rows only if there is not a blank row then it would
have to be re-written.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"JB" wrote in message
...
Thanks Don. I'll do that. Here's another quick question: Every time I
run
my new Macro you gave me, the Macro records what it's doing and changes
itself so that when I go to run it again, it adds 6 blank rows. How do I
get
it to stop changing itself?

"Don Guillett" wrote:

Glad to help
If you're new to macros, you may want to read David McRitchie's
intro
at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"JB" wrote in message
...
Disregard my last post. I tried this as a Macro and it worked
perfectly.
Thanks Mr. Guillett!

"JB" wrote:

Yikes! I'm a bit of a novice here. What is this you just wrote? Is
it
a
macro?

"Don Guillett" wrote:

Sub insert3rows()
For i = Cells(Rows.Count, "a").End(xlUp).Row To 1 Step -1
Rows(i).Resize(3).Insert
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"JB" wrote in message
...
How can I quickly insert 3 blank rows between a list of many
items?
For
example, I have the following list of items in cells a1 thru a5
and I
want
to
quickly insert 3 blank rows between each item, without having to
do
each
one
at a time:

John
James
Joe
Nancy
Steve

Thanks for the help.







All times are GMT +1. The time now is 07:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com