I have some code that opens another workbook and runs a macro in the second workbook.
Is there a way that I can use a variable that is set in the first workbook and read it in the code in the second workbook.
Thanks
I have some code that opens another workbook and runs a macro in the second workbook.
Is there a way that I can use a variable that is set in the first workbook and read it in the code in the second workbook.
Thanks
Yes, any variables you set in your macro are available to use until the macro exits, even in secondary workbooks that are opened in the process. You'll have to present a more detailed question and some sample code showing what you want to do.
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
?None of us is as good as all of us? - Ray Kroc
?Actually, I *am* a rocket scientist.? - JB (little ones count!)
Code in workbook1
Code in second workbook![]()
Please Login or Register to view this content.
What I want to happen is Setup will only be called if the the workbook has not been opened by the first workbook.![]()
Please Login or Register to view this content.
However data_feed_active in the second workbook is empty
Before spending any time on your approach, I would simply disable other macros from running while my first macro is doing it's thing:
![]()
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks