I try to keep my macro code as simple and readable as possible.
I know that I can refer to a named range (with global scope) within ThisWorkbook by simply using the range name in brackets, such as:
But how can I most simply refer to a (global) range name in another (open) workbook? The other workbook will be open, and I will have assigned a variable name to it. For example, suppose my macro opens a second file named Budget2018.xlsx, which contains a sheet with the codename MainSheet, and which contains a named range (on MainSheet, with global scope) called TotalIncome (which also does NOT match any named range in ThisWorkbook). Can I do this:![]()
Please Login or Register to view this content.
or is some other syntax required?![]()
Please Login or Register to view this content.
Bookmarks