Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have written a macro in Excel to run a series of key strokes with a fast key, say Alt-a, to initiate the execution. But I need to run that macro many times. One way to do that is pressing Alt-a the needed number of times. May I ask if there is another way that does it simpler? Thanks in advance. Mic |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub currentMacroName()
for i = 1 to 10 ' current code Next End Sub -- Regards, Tom Ogilvy "cyberdude" wrote in message om... Hi, I have written a macro in Excel to run a series of key strokes with a fast key, say Alt-a, to initiate the execution. But I need to run that macro many times. One way to do that is pressing Alt-a the needed number of times. May I ask if there is another way that does it simpler? Thanks in advance. Mic |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Mic
or you can CALL that procedure from another procedure using a loop. Code ------------------- Sub RunMacroManyTines() Dim i As Long For i = 1 To 100 Call YourMacro 'plece here the name of your procedure Next End Sub Sub YourMacro() Debug.Print "hey" End Sub ------------------- -- Message posted from http://www.ExcelForum.com |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
following on from Tom's suggestion you can make the number of times
interactive e.g. Sub currentMacroName() for i = 1 to inputbox("How many times would you like to run the code?","Run Code",10) ' current code Next End Sub "cyberdude" wrote in message om... Hi, I have written a macro in Excel to run a series of key strokes with a fast key, say Alt-a, to initiate the execution. But I need to run that macro many times. One way to do that is pressing Alt-a the needed number of times. May I ask if there is another way that does it simpler? Thanks in advance. Mic |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
is there a simpler way to do this formula? | Excel Worksheet Functions | |||
VBA code simpler? | Excel Discussion (Misc queries) | |||
Complex formula vs. simpler | Excel Worksheet Functions | |||
Another (simpler?) printing problem | Excel Discussion (Misc queries) | |||
Lil Simpler | Excel Programming |