How to activate a user macro within a workbook from another Excel worksheet ? 
Author Message
 How to activate a user macro within a workbook from another Excel worksheet ?

I want to activate a macro within a worksheet by referring to its name from
another Excel worksheet by VBA-code. How can I achieve that ?

Oscar



Sat, 04 Jun 2005 06:33:32 GMT  
 How to activate a user macro within a workbook from another Excel worksheet ?
See the following example:

In Workbook #1 include the following procedure

Sub quicktest()    
    Application.Run ("Book2!WB2")
End Sub

In Workbook #2 create the procedure "WB2"

Sub WB2
    MsgBox "This is how"
End Sub

The procedure in Workbook #1 calls the procedure in
Workbook #2, which is what I understand you are trying to
accomplish.

Bill

Quote:
>-----Original Message-----
>I want to activate a macro within a worksheet by

referring to its name from
Quote:
>another Excel worksheet by VBA-code. How can I achieve
that ?

>Oscar

>.



Sat, 04 Jun 2005 07:03:45 GMT  
 How to activate a user macro within a workbook from another Excel worksheet ?
See the Run method of the Application object in Help.


Quote:
> I want to activate a macro within a worksheet by referring to its name
from
> another Excel worksheet by VBA-code. How can I achieve that ?

> Oscar



Sat, 04 Jun 2005 07:05:17 GMT  
 How to activate a user macro within a workbook from another Excel worksheet ?
Thanks Bill and Bob ,
It has worked for me.



Quote:
> See the following example:

> In Workbook #1 include the following procedure

> Sub quicktest()
>     Application.Run ("Book2!WB2")
> End Sub

> In Workbook #2 create the procedure "WB2"

> Sub WB2
>     MsgBox "This is how"
> End Sub

> The procedure in Workbook #1 calls the procedure in
> Workbook #2, which is what I understand you are trying to
> accomplish.

> Bill

> >-----Original Message-----
> >I want to activate a macro within a worksheet by
> referring to its name from
> >another Excel worksheet by VBA-code. How can I achieve
> that ?

> >Oscar

> >.



Sat, 04 Jun 2005 07:22:13 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. worksheet activate within workbook open event

2. Going from a worksheet within a workbook to the first sheet in a workbook

3. saving worksheets within a workbook as separate workbooks

4. sending info right to Excel Worksheet within Workbook

5. ActiveX worksheet controls, copying a worksheet within a workbook

6. Stop a user viewing a macro switching btetween worksheets and workbooks

7. how to delete a macro within an Excel Workbook

8. How to prevent last worksheet on save from being activated on opening a workbook

9. worksheet activate code in this workbook

10. Emailing an Excel Worksheet (not a workbook) via VBA macro


 
Powered by phpBB® Forum Software © phpBB Group