View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Otto Moehrbach Otto Moehrbach is offline
external usenet poster
 
Posts: 1,090
Default Running macro x # of times with a prompt

Something like this perhaps. HTH Otto
Sub New_Contractor()
Dim Num As Long
Dim c As Long
Num = Application.InputBox(Prompt:="Enter the number desired", Type:=1)
Application.ScreenUpdating = False
For c = 1 To Num
ActiveSheet.Protect UserInterfaceOnly:=True
Rows("20:50").Select
Selection.Copy
Rows("51:51").Select
Selection.Insert Shift:=xlDown
Application.CutCopyMode = False
Range("D52:I52").Select
ActiveWindow.SmallScroll Down:=8
Next c
Application.ScreenUpdating = True
End Sub
"Redskinsfan" wrote in message
...
I have this macro and i want to have a prompt come up and ask how many
times
the user wants to run it.. Thanks in advance

Sub New_Contractor()
'
' New_Contractor Macro
' Macro recorded 8/3/2006 by Parsons User
'

'
ActiveSheet.Protect UserInterfaceOnly:=True
Rows("20:50").Select
Selection.Copy
Rows("51:51").Select
Selection.Insert Shift:=xlDown
Application.CutCopyMode = False
Range("D52:I52").Select
ActiveWindow.SmallScroll Down:=8
End Sub