ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Continuous Macros (https://www.excelbanter.com/excel-programming/382275-continuous-macros.html)

Beep Beep

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

Ken

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




Jim Thomlinson

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


Don Guillett

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




Beep Beep

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





Don Guillett

Continuous Macros
 
What's the . for?

--
Don Guillett
SalesAid Software

"Beep Beep" wrote in message
...
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







Beep Beep

Continuous Macros
 
Thanks Don

I took out the . and AptOneInvoice still runs fine, however it still does
not continue on to the next macro AptTwoInvoice

Thanks
Frank

"Don Guillett" wrote:

What's the . for?

--
Don Guillett
SalesAid Software

"Beep Beep" wrote in message
...
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







Beep Beep

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


Alan[_2_]

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




gerdmain

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


Beep Beep

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





Beep Beep

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





Don Guillett

Continuous Macros
 
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







Beep Beep

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








All times are GMT +1. The time now is 08:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com