Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have macros in vba behind 4 of my worksheets. How can I combine them into 1
macro and be able to just run one? Here's what I put into a module but it doesn't seem to be working: Sub RunAvonReports() CopyOpenOrders CopyBookings CopyShipments CopyNotInvoiced End Sub Those are the 4 macros I'm trying to run at once. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Sat, 31 Jan 2009 13:28:09 -0800, Secret Squirrel
wrote: I have macros in vba behind 4 of my worksheets. How can I combine them into 1 macro and be able to just run one? Here's what I put into a module but it doesn't seem to be working: Sub RunAvonReports() CopyOpenOrders CopyBookings CopyShipments CopyNotInvoiced End Sub Those are the 4 macros I'm trying to run at once. Try the following: Sub RunAvonReports() Sheet1.CopyOpenOrders Sheet2.CopyBookings Sheet3.CopyShipments Sheet4.CopyNotInvoiced End Sub Replace Sheet1 etc with your own sheet names. Hope this helps / Lars-Åke |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi
And that would work except I'd change it to this Sub RunAvonReports() Call CopyOpenOrders Call CopyBookings Call CopyShipments Call CopyNotInvoiced End Sub The calll statement issn't necessary it's assumed but try remembering in 12 months time what you were doing without it. You must of course have subs of those names Sub CopyOpenOrders() 'do things End Sub Mike "Secret Squirrel" wrote: I have macros in vba behind 4 of my worksheets. How can I combine them into 1 macro and be able to just run one? Here's what I put into a module but it doesn't seem to be working: Sub RunAvonReports() CopyOpenOrders CopyBookings CopyShipments CopyNotInvoiced End Sub Those are the 4 macros I'm trying to run at once. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Running Macros | Links and Linking in Excel | |||
Running Macros | Excel Discussion (Misc queries) | |||
Running Macros | Excel Worksheet Functions | |||
running macros | Excel Discussion (Misc queries) | |||
HELP - Running Macros in VBA | New Users to Excel |