ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Issuing macro in workbook from separate workbook (https://www.excelbanter.com/excel-discussion-misc-queries/26304-issuing-macro-workbook-separate-workbook.html)

Nigel

Issuing macro in workbook from separate workbook
 
Hi,
Can a macro be issued from another macro in another workbook?
i have a macro which copies cell contents, opens another workbook and looks
in range for a matching number. i can get as far as using one macro to copy
the selection and open the workbook, and another macro to select the sheet
required, match the number and paste the contents. However, i cannot issue
the other workbook macro from my button. i need to be able to start the other
macro with a command or correct input to start it.
my thought was
[personal.xls]workcell ( but this doesn't work )

Kind Regards,

Nigel

Bob Phillips

Nigel,

Try something like


Application.Run "myBook.xls!myMacro()"

or if it has an arguement

Application.Run "myBook.xls!myMacro", "hello you"


--
HTH

Bob Phillips

"Nigel" wrote in message
...
Hi,
Can a macro be issued from another macro in another workbook?
i have a macro which copies cell contents, opens another workbook and

looks
in range for a matching number. i can get as far as using one macro to

copy
the selection and open the workbook, and another macro to select the sheet
required, match the number and paste the contents. However, i cannot issue
the other workbook macro from my button. i need to be able to start the

other
macro with a command or correct input to start it.
my thought was
[personal.xls]workcell ( but this doesn't work )

Kind Regards,

Nigel





All times are GMT +1. The time now is 11:22 PM.

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