ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Execute code from book1 of code from book2 (https://www.excelbanter.com/excel-programming/390723-execute-code-book1-code-book2.html)

Rick

Execute code from book1 of code from book2
 
Is there a way of executing code that is in book2 from book1 via VB Code?


Tom Ogilvy

Execute code from book1 of code from book2
 
application.Run "Book2.xls!MyMacro"

--
Regards,
Tom Ogilvy


"Rick" wrote:

Is there a way of executing code that is in book2 from book1 via VB Code?


vbapro

Execute code from book1 of code from book2
 
Application.Run "Book2.xls!module1.MyMacro"

"Rick" wrote:

Is there a way of executing code that is in book2 from book1 via VB Code?


Chip Pearson

Execute code from book1 of code from book2
 
You can use Application.Run.

Application.Run "Book2.xls!ProcedureName"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting LLC
www.cpearson.com
(email on the web site)

"Rick" wrote in message
...
Is there a way of executing code that is in book2 from book1 via VB Code?




Rick

Execute code from book1 of code from book2
 
Thanks for the help

"vbapro" wrote:

Application.Run "Book2.xls!module1.MyMacro"

"Rick" wrote:

Is there a way of executing code that is in book2 from book1 via VB Code?



All times are GMT +1. The time now is 12:40 PM.

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