Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Both methods work for me.
If you tried to used Range("OnSiteRate").value in a sheet module and the named range "OnSiteRate" was on another sheet, then you have to qualify it with the sheet name where it exists because an unqualifed "Range" reference in a sheet module is the same as saying me.Range In a general module, you don't have this problem. -- Regards, Tom Ogilvy "tbone" wrote in message ... I'm not very experienced with Excel VBA yet, so I often use the immediate window to try out various syntax before coding it up. I found something that works in the immediate window when nothing is running: ? Range("OnSiteRate").value does NOT work when the code is run or in the immediate window with the code paused due to the error. I found a workaround: ? ThisWorkbook.Names("OnSiteRate").RefersToRange but I'm curious as to why this doesn't work in both circumstances. Thanks tbone |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA code to affect value of a named range | Excel Discussion (Misc queries) | |||
Named ranges vs setting range in code | Excel Programming | |||
named range problem | Excel Programming | |||
How to conditional color a named range in VBA code | Excel Programming | |||
Named Range Fails in VBA Code | Excel Programming |