Jack Sheet
New Member
- Joined
- Oct 18, 2007
- Messages
- 37
Hi.
I have a globally defined named range called "Year" that refers to
=Rates!$B$3:$X$3
In a worksheet "Model (1)" I have a B1 cell on which the data validation is set to "Pick from list", and that list is defined as
=Year
So far so good. I believe that this would not have worked had the name "Year" been localised to "Rates!Year". A named range referred to in data validation has to be either local to the worksheet containing the validated cell, or else a global name. It cannot be localised to another sheet.
Also in worksheet "Model (1)" I have another cell C1 which contains a formula
=Match($B$1,Year,0)
I wish to create a duplicate of worksheet "Model (1)", which will be called "Model (2)". In the worksheet "Model (2)" I wish to be able to select an entry for cell B1 by Pick from list, with reference to the list contained in the range Year. And I should like the corresponding cell C1 in "Model (2)" to evaluate to =Match('Model (2)'!B1,Year,0).
At some later date I may wish to add additonal entries to Year, without having to update all of the "Model (x)" worksheets.
As it stands, the whole thing falls down, because when I create a duplicate of "Model (1)", the cell 'Model (2)'!C1 evaluates to #N/A while the Pick from list validation in cell 'Model (2)'!B1 is disabled, because the named range referred to in the validation evaluates to an error.
The cause of the problem seems to be that when I duplicate Model (1), Excel also creates a duplicate of the name "Year" which it localises to "Model (2)", and both the validation and formulae choose to refer to the localised name in preference to the global one
I could solve this by VBA, so that whenever I create a duplicate worksheet I delete the corresponding localised name, and correct the formula and validation as necessary in cells B1 and C1 of the new worksheet, all within the VBA routine. But I would rather have a solution that does not involve VBA (there are currently no VBA modules in this workbook and I would rather it stayed that way).
This is surely a wheel that has already been invented, so I should be grateful for some pointers.
Thanks
I have a globally defined named range called "Year" that refers to
=Rates!$B$3:$X$3
In a worksheet "Model (1)" I have a B1 cell on which the data validation is set to "Pick from list", and that list is defined as
=Year
So far so good. I believe that this would not have worked had the name "Year" been localised to "Rates!Year". A named range referred to in data validation has to be either local to the worksheet containing the validated cell, or else a global name. It cannot be localised to another sheet.
Also in worksheet "Model (1)" I have another cell C1 which contains a formula
=Match($B$1,Year,0)
I wish to create a duplicate of worksheet "Model (1)", which will be called "Model (2)". In the worksheet "Model (2)" I wish to be able to select an entry for cell B1 by Pick from list, with reference to the list contained in the range Year. And I should like the corresponding cell C1 in "Model (2)" to evaluate to =Match('Model (2)'!B1,Year,0).
At some later date I may wish to add additonal entries to Year, without having to update all of the "Model (x)" worksheets.
As it stands, the whole thing falls down, because when I create a duplicate of "Model (1)", the cell 'Model (2)'!C1 evaluates to #N/A while the Pick from list validation in cell 'Model (2)'!B1 is disabled, because the named range referred to in the validation evaluates to an error.
The cause of the problem seems to be that when I duplicate Model (1), Excel also creates a duplicate of the name "Year" which it localises to "Model (2)", and both the validation and formulae choose to refer to the localised name in preference to the global one
I could solve this by VBA, so that whenever I create a duplicate worksheet I delete the corresponding localised name, and correct the formula and validation as necessary in cells B1 and C1 of the new worksheet, all within the VBA routine. But I would rather have a solution that does not involve VBA (there are currently no VBA modules in this workbook and I would rather it stayed that way).
This is surely a wheel that has already been invented, so I should be grateful for some pointers.
Thanks
Last edited: