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:
[TotalExpenses].ClearContents
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:
Dim BudgetFile    As Workbook
Dim MyIncome    As Double
...
(code to open Budget2018.xlsx, which becomes the active workbook)
Set BudgetFile = ActiveWorkbook
...
MyIncome = BudgetFile.[TotalIncome]
or is some other syntax required?