Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
make excel copy a row and automatically insert new rows
How do I make excel copy a row and then automatically insert new rows that
are copies of that row based on a number input by a user (i.e. a user unoyuts '10' in a cell excel copies the content of row 51 abd then inserts 10 new rows that are copies of row 51)? |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
make excel copy a row and automatically insert new rows
Sub copyrows()
numrows = InputBox("Number of rows") 'Rows(ActiveCell.Row).Copy ActiveCell.Resize(numrows) Rows(ActiveCell.Row).Copy ActiveCell.Resize(numrows).Insert Application.CutCopyMode = False End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Robin" wrote in message ... How do I make excel copy a row and then automatically insert new rows that are copies of that row based on a number input by a user (i.e. a user unoyuts '10' in a cell excel copies the content of row 51 abd then inserts 10 new rows that are copies of row 51)? |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
make excel copy a row and automatically insert new rows
Don,
Thank you for your help. Was able to get your code to work (copy and insert rows in Excel). It worked good. I do have a follow-on question. Is there a way to get one of the copied cells to increment based on a starting number in the row to be copied? In other words, in the row to be copied there is a cell with a value of '1' and we need that value to be incremented for each new row that is inserted. So, if we have Excel insert ten additional rows, that number should be incremented from '1' in the copied row all the way to '11' in the newly inserted rows. Sincerely, Robin Does that make sense? "Don Guillett" wrote: Sub copyrows() numrows = InputBox("Number of rows") 'Rows(ActiveCell.Row).Copy ActiveCell.Resize(numrows) Rows(ActiveCell.Row).Copy ActiveCell.Resize(numrows).Insert Application.CutCopyMode = False End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Robin" wrote in message ... How do I make excel copy a row and then automatically insert new rows that are copies of that row based on a number input by a user (i.e. a user unoyuts '10' in a cell excel copies the content of row 51 abd then inserts 10 new rows that are copies of row 51)? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Automatically Insert New Rows | Excel Discussion (Misc queries) | |||
How can I set excel to automatically insert rows | Excel Worksheet Functions | |||
how do you have rows automatically insert in excel? | Excel Worksheet Functions | |||
Automatically insert page break every 6 rows in excel doc | Excel Discussion (Misc queries) | |||
Automatically insert row and copy formula | Excel Worksheet Functions |