Refence a global in a another VBA Project

G

Guest

hi,

I have an application which has multiple workbooks open at a time. Is it
possible to get access to the global variable in the VBA Project for workbook
A from code in workbook B.

Thank you,
Chris
 
G

Guest

The best way is to create a refernce to the other workbook. By default your
workbook code is VBAProject (The code name in the VBE). If you right click on
the project and select properties you can change the name to something more
meaningful. Do this for both of the workbooks A and B. Now in workbook B
select Tools -> References -> and create a reference to workbook A (project
name). You can now directly reference the global variable in workbook A from
Workbook B.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top