Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Define Variable for multiple workbooks 1

Status
Not open for further replies.

jeffreypaul

Technical User
Jan 2, 2003
12
US
Is it possible to define a variable in one workbook module and reference it in another workbook?

I want to call a subroutine from another workbook and have it recognize a variable set in the calling workbook subroutine. (It's a utility subroutine that I'd like to call from any other workbook)

A 'Public' variable works only in the same workbook.

The only way I've found is to make an 'optional' argument for that variable in the called subroutine?

I'm trying to pass an array ex: MyList() to the called subroutine.

Thanks!
 
Your approach of using an argument to the macro seems like the most reasonable one. Is there a problem with that approach?
Rob
[flowerface]
 
That will work, I wasn't sure you could pass an array with all it's data via the argument syntax, but it appears to work. Thanks for the help. I just wanted to make sure there wasn't a simplier way.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top