Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 355
Default Call another Macro

How do I call a workbook module in a worksheet module

Private Sub Commandbutton1_Click()
My Code
Then when complete call

Sub Update()

Thanks!



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Call another Macro

Private Sub Commandbutton1_Click()
' My Code
Update
End sub


or (less used)

Private Sub Commandbutton1_Click()
' My Code
Call Update()
End sub

--
Regards,
Tom Ogilvy

"Sandy" wrote in message
...
How do I call a workbook module in a worksheet module

Private Sub Commandbutton1_Click()
My Code
Then when complete call

Sub Update()

Thanks!





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Call another Macro

Sandy,

In the worksheet's codemodule:

Private Sub Commandbutton1_Click()
'Your code here
Update
End Sub

In a regular module:
Sub Update()
'Your other code here
End Sub

HTH,
Bernie
MS Excel MVP

"Sandy" wrote in message
...
How do I call a workbook module in a worksheet module

Private Sub Commandbutton1_Click()
My Code
Then when complete call

Sub Update()

Thanks!





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 195
Default Call another Macro

Tom Ogilvy wrote

Private Sub Commandbutton1_Click()
' My Code
Call Update()
End sub


Using XL2000 at least, I've found that Call Update works without the '()',
but I normally just use Update

--
David
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Call another Macro

Since there are no arguments for the Update Sub, that is true. I was trying
to emphasize that if you use the CALL syntax, that the arguments must be
enclosed in parentheses. Conversely, if you don't use call, they should not
be enclosed in parentheses unless it is a function returning a value that is
used by the calling program.

--
Regards,
Tom Oglvy

"David" wrote in message
...
Tom Ogilvy wrote

Private Sub Commandbutton1_Click()
' My Code
Call Update()
End sub


Using XL2000 at least, I've found that Call Update works without the '()',
but I normally just use Update

--
David



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
Call Macro jswalsh33 Excel Discussion (Misc queries) 2 February 21st 10 10:38 AM
How can run a macro ( call a macro) on selection of any filtercriteria? [email protected] Excel Worksheet Functions 7 February 20th 09 12:34 AM
Call an Access macro from an Excel macro Jason W Excel Discussion (Misc queries) 1 May 1st 08 08:33 PM
macro call Steve Excel Discussion (Misc queries) 12 August 25th 06 04:27 AM
How to call a macro in an XLA add-in Peter Laman Excel Discussion (Misc queries) 1 March 10th 05 05:40 PM


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

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

About Us

"It's about Microsoft Excel"