LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default Macro Modification Help

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


 
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
Macro Modification Help akemeny Excel Discussion (Misc queries) 1 December 3rd 08 06:11 PM
macro - modification yshridhar Excel Discussion (Misc queries) 10 February 1st 08 03:47 AM
Macro Modification carl Excel Worksheet Functions 0 May 4th 07 04:17 PM
Macro Modification Carl Excel Worksheet Functions 2 August 30th 06 01:53 PM
Macro Modification Help Dmorri254 Excel Worksheet Functions 0 March 4th 05 03:51 PM


All times are GMT +1. The time now is 01:15 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"