Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35
Default Inserting Blank rows after every row upto 2500 rows

Is there a command to insert blank rows automatically between already
existing data of more than 2000 lines?
I need this to automatically copy and paste with ceratin number of
blank rows to another software. Now what I do is a laborious process
and takes a lot of time
Can anyone please help? Thanks in advance

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,124
Default Inserting Blank rows after every row upto 2500 rows

this will insert rows
Sub insertrows()
lr = Cells(Rows.Count, "a").End(xlUp).Row
For i = lr To 2 Step -1
Rows(i).Insert
Next i
End Sub

OR, if you just need space,consider doubling the row height.
Sub makerowbigger()
lr = Cells(Rows.Count, "a").End(xlUp).Row
Rows("1:" & lr).RowHeight = 25
End Sub

--
Don Guillett
SalesAid Software

"Manju" wrote in message
oups.com...
Is there a command to insert blank rows automatically between already
existing data of more than 2000 lines?
I need this to automatically copy and paste with ceratin number of
blank rows to another software. Now what I do is a laborious process
and takes a lot of time
Can anyone please help? Thanks in advance



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 179
Default Inserting Blank rows after every row upto 2500 rows

pls try this code

Sub Macro1()
Dim totR As Variant
Dim k As Integer
ActiveSheet.UsedRange.Select
totR = Selection.Rows.Count
k = 1
For i = 2000 To totR Step 2000
Range("A" & i + k).Select
Selection.EntireRow.Insert
k = k + 1
Next i
Range("A1").Select
End Sub



"Manju" wrote:

Is there a command to insert blank rows automatically between already
existing data of more than 2000 lines?
I need this to automatically copy and paste with ceratin number of
blank rows to another software. Now what I do is a laborious process
and takes a lot of time
Can anyone please help? Thanks in advance


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35
Default Inserting Blank rows after every row upto 2500 rows


Don Guillett wrote:
this will insert rows
Sub insertrows()
lr = Cells(Rows.Count, "a").End(xlUp).Row
For i = lr To 2 Step -1
Rows(i).Insert
Next i
End Sub

OR, if you just need space,consider doubling the row height.
Sub makerowbigger()
lr = Cells(Rows.Count, "a").End(xlUp).Row
Rows("1:" & lr).RowHeight = 25
End Sub

--
Don Guillett
SalesAid Software



Sorry Sir, Your first code didn't work.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35
Default Inserting Blank rows after every row upto 2500 rows

Dear Rafeek, Thanks
I had to insert manually row number for this to work. Any way thanks.
that will do.


Muhammed Rafeek M wrote:
pls try this code

Sub Macro1()
Dim totR As Variant
Dim k As Integer
ActiveSheet.UsedRange.Select
totR = Selection.Rows.Count
k = 1
For i = 2000 To totR Step 2000
Range("A" & i + k).Select
Selection.EntireRow.Insert
k = k + 1
Next i
Range("A1").Select
End Sub



"Manju" wrote:

Is there a command to insert blank rows automatically between already
existing data of more than 2000 lines?
I need this to automatically copy and paste with ceratin number of
blank rows to another software. Now what I do is a laborious process
and takes a lot of time
Can anyone please help? Thanks in advance





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Inserting Blank rows after every row upto 2500 rows

Manju

Don's code works fine for me.

What didn't it do for you?


Gord Dibben MS Excel MVP

On 21 Aug 2006 19:12:21 -0700, "Manju" wrote:


Don Guillett wrote:
this will insert rows
Sub insertrows()
lr = Cells(Rows.Count, "a").End(xlUp).Row
For i = lr To 2 Step -1
Rows(i).Insert
Next i
End Sub

OR, if you just need space,consider doubling the row height.
Sub makerowbigger()
lr = Cells(Rows.Count, "a").End(xlUp).Row
Rows("1:" & lr).RowHeight = 25
End Sub

--
Don Guillett
SalesAid Software



Sorry Sir, Your first code didn't work.


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default Inserting Blank rows after every row upto 2500 rows

Manju
If you are not happy with vb code an alternative is to set up a new column
and insert number 1,3,5 etc until the last row of data.
Then continue with 2,4,6 etc until you match the number of odd rows.
Note you can use autofill - don't enter every number!.
Then select the whole block and sort on the column with the numbers.
You will then have 1=data,2=blank,3=data, 4=blank etc.
Whole operation takes less than a minute to do.
--
Don C


"Manju" wrote:

Is there a command to insert blank rows automatically between already
existing data of more than 2000 lines?
I need this to automatically copy and paste with ceratin number of
blank rows to another software. Now what I do is a laborious process
and takes a lot of time
Can anyone please help? Thanks in advance


  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35
Default Inserting Blank rows after every row upto 2500 rows

Dear Sir,
That's what I require!. I am still new to VB. This kind of ideas is
what I like and usually execute. Thanks a ton.

DonCam65 wrote:
Manju
If you are not happy with vb code an alternative is to set up a new column
and insert number 1,3,5 etc until the last row of data.
Then continue with 2,4,6 etc until you match the number of odd rows.
Note you can use autofill - don't enter every number!.
Then select the whole block and sort on the column with the numbers.
You will then have 1=data,2=blank,3=data, 4=blank etc.
Whole operation takes less than a minute to do.
--
Don C


"Manju" wrote:

Is there a command to insert blank rows automatically between already
existing data of more than 2000 lines?
I need this to automatically copy and paste with ceratin number of
blank rows to another software. Now what I do is a laborious process
and takes a lot of time
Can anyone please help? Thanks in advance



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
Inserting blank rows in Excel. kwm5321 Excel Discussion (Misc queries) 3 December 1st 06 12:19 AM
Get number of rows that data takes up, including blank rows Denham Coote Excel Worksheet Functions 2 August 21st 06 09:18 AM
Help!! I have problem deleting 2500 rows of filtered rows!!!! shirley_kee Excel Discussion (Misc queries) 1 January 12th 06 03:24 AM
inserting columns within certain rows only crimsonkng Excel Discussion (Misc queries) 4 July 14th 05 05:13 PM
Automatically inserting rows ausdiver99 Excel Worksheet Functions 1 June 2nd 05 02:15 PM


All times are GMT +1. The time now is 12:28 AM.

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"