ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Insert Rows between the existing rows (https://www.excelbanter.com/excel-discussion-misc-queries/49413-insert-rows-between-existing-rows.html)

Pradeep Patel

Insert Rows between the existing rows
 
Hi,

I have requirements for inserting a blank row in-between existing rows. So I
have let say 300 rows with data and I want to insert a blank row after each
exisitng data row. Is there anything available in Excel? or I have no option
but to manually inserting each row. Please help!!!

Thank you

Ron de Bruin

Hi Pradeep

Try this macro

Sub test()
Application.ScreenUpdating = False
Dim numRows As Integer
Dim R As Long
Dim rng As Range
numRows = 1
Set rng = ActiveSheet.UsedRange
For R = rng.Rows.Count To 1 Step -1
rng.Rows(R + 1).Resize(numRows).EntireRow.insert
Next R
Application.ScreenUpdating = True
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Pradeep Patel" wrote in message ...
Hi,

I have requirements for inserting a blank row in-between existing rows. So I
have let say 300 rows with data and I want to insert a blank row after each
exisitng data row. Is there anything available in Excel? or I have no option
but to manually inserting each row. Please help!!!

Thank you




Gord Dibben

Do you really need the blanks rows?

If so, go with Ron's solution.

If just for appearance, select all rows and double the height.


Gord Dibben Excel MVP

On Sat, 8 Oct 2005 04:29:03 -0700, "Pradeep Patel"
wrote:

Hi,

I have requirements for inserting a blank row in-between existing rows. So I
have let say 300 rows with data and I want to insert a blank row after each
exisitng data row. Is there anything available in Excel? or I have no option
but to manually inserting each row. Please help!!!

Thank you



Pradeep Patel

Ron,

Yes, your macro works. I appreciate your quick help. Thank you very much.

Pradeep

"Ron de Bruin" wrote:

Hi Pradeep

Try this macro

Sub test()
Application.ScreenUpdating = False
Dim numRows As Integer
Dim R As Long
Dim rng As Range
numRows = 1
Set rng = ActiveSheet.UsedRange
For R = rng.Rows.Count To 1 Step -1
rng.Rows(R + 1).Resize(numRows).EntireRow.insert
Next R
Application.ScreenUpdating = True
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Pradeep Patel" wrote in message ...
Hi,

I have requirements for inserting a blank row in-between existing rows. So I
have let say 300 rows with data and I want to insert a blank row after each
exisitng data row. Is there anything available in Excel? or I have no option
but to manually inserting each row. Please help!!!

Thank you





Pradeep Patel

Thank you Gord, Ron's Macro is working fine.

"Gord Dibben" wrote:

Do you really need the blanks rows?

If so, go with Ron's solution.

If just for appearance, select all rows and double the height.


Gord Dibben Excel MVP

On Sat, 8 Oct 2005 04:29:03 -0700, "Pradeep Patel"
wrote:

Hi,

I have requirements for inserting a blank row in-between existing rows. So I
have let say 300 rows with data and I want to insert a blank row after each
exisitng data row. Is there anything available in Excel? or I have no option
but to manually inserting each row. Please help!!!

Thank you





All times are GMT +1. The time now is 01:05 PM.

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