Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 172
Default Running 4 macros at once

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 913
Default Running 4 macros at once

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Running 4 macros at once

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Running Macros Links and Linking in Excel 3 July 13th 06 11:30 PM
Running Macros Excel Discussion (Misc queries) 1 July 6th 06 04:21 PM
Running Macros Excel Worksheet Functions 0 July 6th 06 03:42 PM
running macros Jay Excel Discussion (Misc queries) 2 April 29th 05 12:56 AM
HELP - Running Macros in VBA Louise New Users to Excel 7 April 6th 05 03:21 PM


All times are GMT +1. The time now is 07:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"