Thread: Named ranges
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Named ranges

Hi Shawn

You can use the same name more then one time.
This example will add the name ron in all your sheets

Sub Give_name_on_all_sheets()
Dim Sh As Worksheet
For Each Sh In ThisWorkbook.Worksheets
Sh.Range("a1").Name = Sh.Name & "!ron"
Next
Sheets(1).Select
End Sub

in a cell use =ron to get the value from cell A1 on that sheet

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Shawn" wrote in message ...
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