Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
insert rows in a worksheet that do not change adjoining rows | Excel Discussion (Misc queries) | |||
How do i insert blank rows between data that is thousands of rows | Excel Discussion (Misc queries) | |||
Insert rows: Formats & formulas extended to additonal rows | Excel Worksheet Functions | |||
How do I insert blank rows between rows in completed worksheet? | Excel Discussion (Misc queries) | |||
How do i insert of spacer rows between rows in large spreadsheets | Excel Discussion (Misc queries) |