Qualification of Named Ranges

Peter__

New Member
Joined
Sep 16, 2011
Messages
8
When you refer to a named range, does it need to be qualified?

I'm sure I've referred to named ranges in the past without qualifying them with which sheet they're on, but just today I'm getting "method 'name' of object '_global' excel" failed".

Am I on drugs to think this ever worked? Or have I just been lucky that when ever I've used them in the past, the sheet containing the range just happens to be the active sheet? Or is there some other factor that effects when you need to qualify the named range and when you don't?
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Depending on how it was scoped at creation, a Name is scoped to either a workbook or a worksheet.
Syntax like this qualifies it.
Workbooks("myWorkbook.xlsm").Names("myNamedRange").RefersToRange

Use WorkBooks("myWorkbook.xlsm").Worksheets("Sheet1") if the name is scoped a the worksheet level.
 
Upvote 0
Thanks Mike,

How do you specify the scope? I have always just type the name into the address box in the top left corner -- what scope would that have?
 
Upvote 0

Forum statistics

Threads
1,224,352
Messages
6,178,071
Members
452,822
Latest member
MtC

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top