Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Continuous Macros
I have a number (7) of macros and would like to go to each one when the
previous one is finished running. I forgot the vba command to put at the end of the macro to direct it to the next macro. Thanks Frank |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Continuous Macros
Frank
Try Call Macro2 at the end of Macro1, or just Macro2 at the end of Macro1. Good luck. Ken Norfolk, Va On Jan 30, 5:55 pm, Beep Beep wrote: I have a number (7) of macros and would like to go to each one when the previous one is finished running. I forgot the vba command to put at the end of the macro to direct it to the next macro. Thanks Frank |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Continuous Macros
I would be more inclined to add a main calling procedure instead of chaining
the macros together. That way they stay as stand alone parts able to run individually... Try something like this... Sub RunAll () call Macro1 Call Macro2 Call Macro3 end sub Sub Macro1() msgbox "Macro1" end sub Sub Macro2() msgbox "Macro2" end sub Sub Macro3() msgbox "Macro3" end sub -- HTH... Jim Thomlinson "Beep Beep" wrote: I have a number (7) of macros and would like to go to each one when the previous one is finished running. I forgot the vba command to put at the end of the macro to direct it to the next macro. Thanks Frank |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Continuous Macros
sub macro1 blah macro2 end sub or put em together -- Don Guillett SalesAid Software "Beep Beep" wrote in message ... I have a number (7) of macros and would like to go to each one when the previous one is finished running. I forgot the vba command to put at the end of the macro to direct it to the next macro. Thanks Frank |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Continuous Macros
Thanks Ken.
Here is what I added to the end of macro Sub AptOneInvoice() Sub AptOneInvoice() going through AptSevenInvoice() I tried adding your suggestion but must be doing something wrong Here is what I added: Call .AptTwoInvoice only to get the message Invalid or unqualified message. Thanks Frank Here is what my macros are called. "Ken" wrote: Frank Try Call Macro2 at the end of Macro1, or just Macro2 at the end of Macro1. Good luck. Ken Norfolk, Va On Jan 30, 5:55 pm, Beep Beep wrote: I have a number (7) of macros and would like to go to each one when the previous one is finished running. I forgot the vba command to put at the end of the macro to direct it to the next macro. Thanks Frank |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Continuous Macros
|
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Continuous Macros
Thanks Jim:
Here is what I got. The message I get is AptOneInvoice OK and so on for the three of them. However it does not appear to run the actual individual macros. Thanks Frank ' SubRun Macro ' Macro recorded 1/30/2007 by Frank Sub RunAll() Call AptOneInvoice Call AptTwoInvoice Call AptThreeInvoice End Sub Sub AptOneInvoice() MsgBox "AptOneInvoice" End Sub Sub AptTwoInvoice() MsgBox "AptTwoInvoice" End Sub Sub AptThreeInvoice() MsgBox "AptThreeInvoice" End Sub "Jim Thomlinson" wrote: I would be more inclined to add a main calling procedure instead of chaining the macros together. That way they stay as stand alone parts able to run individually... Try something like this... Sub RunAll () call Macro1 Call Macro2 Call Macro3 end sub Sub Macro1() msgbox "Macro1" end sub Sub Macro2() msgbox "Macro2" end sub Sub Macro3() msgbox "Macro3" end sub -- HTH... Jim Thomlinson "Beep Beep" wrote: I have a number (7) of macros and would like to go to each one when the previous one is finished running. I forgot the vba command to put at the end of the macro to direct it to the next macro. Thanks Frank |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
Continuous Macros
Hi Frank,
I would suggest creating a new macro to call your macros vs. calling one from another. None of the macros would work stand alone without error except Macro7 which doesn't call another macro. I would call them using something like this: Sub RunMacros() Call Macro1 Call Macro2 Call Macro3 Call Macro4 Call Macro5 Call Macro6 Call Macro7 End Sub Alan "The only dumb question is a question left unasked." "Beep Beep" wrote in message ... I have a number (7) of macros and would like to go to each one when the previous one is finished running. I forgot the vba command to put at the end of the macro to direct it to the next macro. Thanks Frank |
#10
Posted to microsoft.public.excel.programming
|
|||
|
|||
Continuous Macros
Hi,
It's a good start so far. I assume your actual macros are called AptOneInvoice, etc. If this is the case, just delete the lines Sub AptOneInvoice() MsgBox "AptOneInvoice" End Sub Then run the macro RunAll again. If the real AptOneInvoice is now executed, delete the other sub-routines below RunAll() as well. But of course, if the macros are not called AptOneInvoice then you should change the Call statements in RunAll accordingly. -- Gerd "Beep Beep" wrote: Thanks Jim: Here is what I got. The message I get is AptOneInvoice OK and so on for the three of them. However it does not appear to run the actual individual macros. Thanks Frank ' SubRun Macro ' Macro recorded 1/30/2007 by Frank Sub RunAll() Call AptOneInvoice Call AptTwoInvoice Call AptThreeInvoice End Sub Sub AptOneInvoice() MsgBox "AptOneInvoice" End Sub Sub AptTwoInvoice() MsgBox "AptTwoInvoice" End Sub Sub AptThreeInvoice() MsgBox "AptThreeInvoice" End Sub "Jim Thomlinson" wrote: I would be more inclined to add a main calling procedure instead of chaining the macros together. That way they stay as stand alone parts able to run individually... Try something like this... Sub RunAll () call Macro1 Call Macro2 Call Macro3 end sub Sub Macro1() msgbox "Macro1" end sub Sub Macro2() msgbox "Macro2" end sub Sub Macro3() msgbox "Macro3" end sub -- HTH... Jim Thomlinson "Beep Beep" wrote: I have a number (7) of macros and would like to go to each one when the previous one is finished running. I forgot the vba command to put at the end of the macro to direct it to the next macro. Thanks Frank |
#11
Posted to microsoft.public.excel.programming
|
|||
|
|||
Continuous Macros
Thanks Alan:
Unfortunately this did not work. Here is what I got: Sub CallMacros() ' ' CallMacros Macro ' Macro recorded 2/1/2007 by Frank ' Call AptOneInvoice Call AptTwoInvoice Call AptThreeInvoice Call AptFourInvoice Call AptFiveInvoice Call AptSixInvoice Call AptSevenInvoice End Sub "Alan" wrote: Hi Frank, I would suggest creating a new macro to call your macros vs. calling one from another. None of the macros would work stand alone without error except Macro7 which doesn't call another macro. I would call them using something like this: Sub RunMacros() Call Macro1 Call Macro2 Call Macro3 Call Macro4 Call Macro5 Call Macro6 Call Macro7 End Sub Alan "The only dumb question is a question left unasked." "Beep Beep" wrote in message ... I have a number (7) of macros and would like to go to each one when the previous one is finished running. I forgot the vba command to put at the end of the macro to direct it to the next macro. Thanks Frank |
#12
Posted to microsoft.public.excel.programming
|
|||
|
|||
Continuous Macros
Alan I forgot to add the message I got:
"Ambiguous Name Detected: AptOneInvoice "Alan" wrote: Hi Frank, I would suggest creating a new macro to call your macros vs. calling one from another. None of the macros would work stand alone without error except Macro7 which doesn't call another macro. I would call them using something like this: Sub RunMacros() Call Macro1 Call Macro2 Call Macro3 Call Macro4 Call Macro5 Call Macro6 Call Macro7 End Sub Alan "The only dumb question is a question left unasked." "Beep Beep" wrote in message ... I have a number (7) of macros and would like to go to each one when the previous one is finished running. I forgot the vba command to put at the end of the macro to direct it to the next macro. Thanks Frank |
#13
Posted to microsoft.public.excel.programming
|
|||
|
|||
Continuous Macros
|
#14
Posted to microsoft.public.excel.programming
|
|||
|
|||
Continuous Macros
Thanks Everybody that has responded. I hate to amit it but I was using the
name of the file as opposed to the different names of the worksheets. Also Don was correct in that I had two macros named the same. This happened because I had opened another workbook that also had the same macro name and it was seeing two. O well more to learn. Thanks again Frank "Don Guillett" wrote: That means that there are TWO of them. -- Don Guillett SalesAid Software "Beep Beep" wrote in message ... Alan I forgot to add the message I got: "Ambiguous Name Detected: AptOneInvoice "Alan" wrote: Hi Frank, I would suggest creating a new macro to call your macros vs. calling one from another. None of the macros would work stand alone without error except Macro7 which doesn't call another macro. I would call them using something like this: Sub RunMacros() Call Macro1 Call Macro2 Call Macro3 Call Macro4 Call Macro5 Call Macro6 Call Macro7 End Sub Alan "The only dumb question is a question left unasked." "Beep Beep" wrote in message ... I have a number (7) of macros and would like to go to each one when the previous one is finished running. I forgot the vba command to put at the end of the macro to direct it to the next macro. Thanks Frank |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
continuous typing | Excel Discussion (Misc queries) | |||
Continuous Loop | Excel Programming | |||
Continuous Refresh | Excel Discussion (Misc queries) | |||
Continuous Range | Excel Programming | |||
Printing continuous | Excel Discussion (Misc queries) |