Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 83
Default Insert Rows in b/w

Hi

I have a column with few number, i need a macro code which will insert 4
rows after every number

example:
Amount
1
2
3
4
5
Answer:
1



2



3



4
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 4,393
Default Insert Rows in b/w

Sub Macro1()
For irow = Cells(Rows.Count, "A").End(xlUp).Row To 2 Step -1
For k = 1 To 4
Cells(irow, "A").EntireRow.Insert
Next k
Next irow
End Sub

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Ranjit kurian" wrote in message
...
Hi

I have a column with few number, i need a macro code which will insert 4
rows after every number

example:
Amount
1
2
3
4
5
Answer:
1



2



3



4



  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 83
Default Insert Rows in b/w

This code is working fine,Thanks for it.
Could you please explain me the 'irow' concept


"Bernard Liengme" wrote:

Sub Macro1()
For irow = Cells(Rows.Count, "A").End(xlUp).Row To 2 Step -1
For k = 1 To 4
Cells(irow, "A").EntireRow.Insert
Next k
Next irow
End Sub

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Ranjit kurian" wrote in message
...
Hi

I have a column with few number, i need a macro code which will insert 4
rows after every number

example:
Amount
1
2
3
4
5
Answer:
1



2



3



4




  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 10,124
Default Insert Rows in b/w

try this
Sub insertrows()
For i = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1
Rows(i).Resize(4).Insert
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Ranjit kurian" wrote in message
...
Hi

I have a column with few number, i need a macro code which will insert 4
rows after every number

example:
Amount
1
2
3
4
5
Answer:
1



2



3



4


  #5   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 4,393
Default Insert Rows in b/w

It is just a variable name, I could have used "j"
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Ranjit kurian" wrote in message
...
This code is working fine,Thanks for it.
Could you please explain me the 'irow' concept


"Bernard Liengme" wrote:

Sub Macro1()
For irow = Cells(Rows.Count, "A").End(xlUp).Row To 2 Step -1
For k = 1 To 4
Cells(irow, "A").EntireRow.Insert
Next k
Next irow
End Sub

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Ranjit kurian" wrote in message
...
Hi

I have a column with few number, i need a macro code which will insert
4
rows after every number

example:
Amount
1
2
3
4
5
Answer:
1



2



3



4






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
insert rows in a worksheet that do not change adjoining rows craigandmel Excel Discussion (Misc queries) 2 April 29th 08 10:26 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
Insert rows: Formats & formulas extended to additonal rows Twishlist Excel Worksheet Functions 0 October 22nd 07 04:23 AM
How do I insert blank rows between rows in completed worksheet? bblue1978 Excel Discussion (Misc queries) 1 October 26th 06 07:02 PM
How do i insert of spacer rows between rows in large spreadsheets laurel Excel Discussion (Misc queries) 0 April 24th 06 01:38 PM


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

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"