Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You only need to use an InputBox and put the code you have
inside a loop. In what follows the new lines are marked as such. Sub insertrowswithformulas() Dim iCt As Integer 'new Dim iCt2 As Integer 'new iCt2 = InputBox("Enter number of rows to duplicate.") 'new For iCt = 1 To iCt2 'new 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 Next iCt 'new End Sub HTH, Merjet |
Reply |
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 |