Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I have a macro called "insert rows with formulas". What it does is inserts a new row and at the same time it copies all the formulas from the row above into the newly inserted row(s). The issue is it only inserts one row at a time and usually there needs to be several rows entered and copied at once so the user has to keep clicking the macro button for each row to be inserted. How can I modify this code to open an input box, have it ask how many rows to enter, and have the user enter a number for the rows to be entered? Here is the code: Sub insertrowswithformulas() With ActiveCell ..EntireRow.Insert Range(Cells(.Row - 2, "I"), Cells(.Row - 2, "AP")).Copy _ Cells(.Row - 1, "I") Range(Cells(.Row - 2, "B"), Cells(.Row - 2, "G")).Copy _ Cells(.Row - 1, "B") End With End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro Modification Help | Excel Discussion (Misc queries) | |||
macro - modification | Excel Discussion (Misc queries) | |||
Macro Modification | Excel Worksheet Functions | |||
Macro Modification | Excel Worksheet Functions | |||
Macro Modification Help | Excel Worksheet Functions |