You need to set a reference from Workbook A to Workbook B. In VBA with
Workbook B active and open, go to the Tools menu, choose VBA Project
Properties and change the name to something unique like projBookB.
Then, open Workbook A in VBA, go to the Tools menu, choose References,
and put a check next to projBookB. Then, back in Workbook A, you can
reference anything in WorkbookB by prefixing "projBookB." to the
variable name. E.g,.
X = projBookB.MyVariable
If "MyVariable" occurs ONLY in workbook B, not in A, you can omit the
"projBookB." prefix, but I think this is bad form. You should always
use the prefix to indicate that you're linking to another library.
Cordially,
Chip Pearson
Microsoft Most Valuable Professional,
Excel, 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
On Mon, 15 Mar 2010 14:34:01 -0700, BillCPA <Bill @ UAMS wrote:
If I have two workbooks open, and Workbook A has a couple of arrays with
information I want to use in Workbook B, how do I go about getting the
information into Workbook B? I thought using a Public declare would work,
but it doesn't seem to.