Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I have a situation where 2 workbooks are open simultaneously, and I’m trying to reference a named variable (workbook scope) in the inactive workbook.. While experimenting I ran into this. Dim w As Workbook Dim s As Worksheet Set w = ThisWorkbook Set s = w.Sheets("sheet1") w.Names.Add ("Bk"), 99 s.Names.Add ("Sht"), 98 Debug.Print s.[sht] 'this works Debug.Print w.[Bk] 'this raises an error End Sub I must be missing something simple, but for the life of me, I can’t figure out why w.[bk] is raising an error. Appreciate any help on this. Regards, DaveU |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Set macro security level to 'low level' on opening a certain workbook. | Excel Programming | |||
Named ranges scope / workbook/worksheet level named ranges- changeswith variable use... | Excel Programming | |||
Named range in chart - any way to change the workbook reference with VBA | Excel Programming | |||
Concatenate a reference to named ranges in other workbook | Excel Worksheet Functions | |||
Why, when I create workbook-level name does it jump it to Sheet-level ? | Excel Programming |