Home |
Search |
Today's Posts |
#1
|
|||
|
|||
User to decide how often a macro runs
Can anyone help...Please.... I need a macro that asks for the user to input
the number of times it needs to run. Thanks for any help in advance |
#2
|
|||
|
|||
User to decide how often a macro runs
Try something like the following:
Dim NumRuns As Long Dim Ndx As Long NumRuns = Application.InputBox(prompt:="Enter number of times.", _ Type:=1) For Ndx = 1 To NumRuns ' run your macro code here Next Ndx -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Deedee" wrote in message ... Can anyone help...Please.... I need a macro that asks for the user to input the number of times it needs to run. Thanks for any help in advance |
#3
|
|||
|
|||
User to decide how often a macro runs
One way among several:
Sub test() Dim L As Long, X As Long L = Application.InputBox("Pick a number:", Type:=1) For X = 1 To L Call SubProc(X, L) Next End Sub Sub SubProc(L As Long, LMax As Long) MsgBox "Yo da man !", vbExclamation, L & " of " & LMax End Sub HTH. Best wishes Harald "Deedee" skrev i melding ... Can anyone help...Please.... I need a macro that asks for the user to input the number of times it needs to run. Thanks for any help in advance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
I want a macro to save a workbook as a user inputted cell | Excel Discussion (Misc queries) | |||
Macro for user to input 10 numbers | New Users to Excel | |||
macro that brings user to cell based on "yes/no" response | Excel Discussion (Misc queries) | |||
Links in formulas change when another user runs a workbook | Excel Discussion (Misc queries) | |||
Macro for multiple charts | Excel Worksheet Functions |