ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Named ranges (https://www.excelbanter.com/excel-programming/295667-re-named-ranges.html)

Toby Erkson

Named ranges
 
From a previous post it's my understanding that you can have the same name but on different worksheets. You reference the particular named range by prefacing
it with the sheet name i.e. Sheet1!MyNamedRange. I'm a newbie to Excel VBA so don't take my absolute word for this...hopefully another will chime in about
this.

If you are wanting to have multiple named ranges on one sheet with the same name, well, that's simply a bad programming practice that will lead to errors and
confusion...particularly for anyone who has to take over what you've done i.e. you get hit by a Budwieser delivery truck and are laid up in the hospital for a
month ;-)

Toby Erkson
Oregon, USA

On Tue, 20 Apr 2004 07:16:03 -0700, "Shawn" wrote:

Hi

Hi

I just noticed something that was very strange and I need to find out whether or not this is expected. It looks like multiple named ranges with exactly the same name can exist in one workbook. This means that different cells are referenced at different situations if this named range is used in formulas. My understanding was that range names have to be unique within a workbook. Which behaviour is expected?

In addition, if you look through the Insert|Name|Define menu option only one reference shows for a particular duplicated named range.

This may sound like an observation that is not very important but it is very important for what I'm attempting to do.

Thanks a lot

Shawn




All times are GMT +1. The time now is 10:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com