Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Mats Samson
 
Posts: n/a
Default Same Name refers to local ranges

I happened to copy a worksheet with a named range.
Afterwards the named range exists in both sheets as a "local" reference,
i.e. I have the same Name in both sheets and they refer to the same cell in
the respective sheets. If you look in Insert/Define you'll find a sheet
reference to the current sheet, next to the Name.
Is there a way of creating a "local" Name reference to a cell or range,
without splitting sheets? It can be very useful, especially in vba!
Best Regards
Mats

  #2   Report Post  
KL
 
Posts: n/a
Default

Hi Mats,

I am not sure I understand your question, but if you want a defined name
which would refer to a specific range on the sheet where it is called from,
then when defining a name in the 'Refers To:' box use the following notation
("!" will prevent Excel from automatically setting the sheet reference to
the sheet where the name has been created):

=!$A$1

Regards,
KL


"Mats Samson" wrote in message
...
I happened to copy a worksheet with a named range.
Afterwards the named range exists in both sheets as a "local" reference,
i.e. I have the same Name in both sheets and they refer to the same cell
in
the respective sheets. If you look in Insert/Define you'll find a sheet
reference to the current sheet, next to the Name.
Is there a way of creating a "local" Name reference to a cell or range,
without splitting sheets? It can be very useful, especially in vba!
Best Regards
Mats



  #3   Report Post  
Mats Samson
 
Posts: n/a
Default

If you create a worksheet and name Sheet 1 to My.
Then you Define the Name Dummy to cell B2.
Copy the sheet by holding down shift and pull it rightwards and
you'll have the name My (2). Rename this sheet to Your.
If you look in cell B2 on both sheets the name Dummy exists in
both locations but seems to be "worksheet local". there is a side reference
to the sheet for the "replica" in Yours.
You can reference "Dummy" but eventual changes are only locally,
i.e made in the sheet in focus.
Can be rather useful! But I'd like to /create/use it without the awesome
copy technique!
Regards
Mats


"KL" wrote:

Hi Mats,

I am not sure I understand your question, but if you want a defined name
which would refer to a specific range on the sheet where it is called from,
then when defining a name in the 'Refers To:' box use the following notation
("!" will prevent Excel from automatically setting the sheet reference to
the sheet where the name has been created):

=!$A$1

Regards,
KL


"Mats Samson" wrote in message
...
I happened to copy a worksheet with a named range.
Afterwards the named range exists in both sheets as a "local" reference,
i.e. I have the same Name in both sheets and they refer to the same cell
in
the respective sheets. If you look in Insert/Define you'll find a sheet
reference to the current sheet, next to the Name.
Is there a way of creating a "local" Name reference to a cell or range,
without splitting sheets? It can be very useful, especially in vba!
Best Regards
Mats




  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default

Mats,

This will create a local name

Range("A1:B10").Name = ActiveSheet.Name & "!myRange"


See also http://www.xldynamic.com/source/xld.Names.html


You might also want to get a copy of Jan Karel Pieterse's N ame Mangaer,
very useful when working with names.
http://www.jkp-ads.com/OfficeMarketPlaceNM-EN.htm


--
HTH

Bob Phillips

"Mats Samson" wrote in message
...
I happened to copy a worksheet with a named range.
Afterwards the named range exists in both sheets as a "local" reference,
i.e. I have the same Name in both sheets and they refer to the same cell

in
the respective sheets. If you look in Insert/Define you'll find a sheet
reference to the current sheet, next to the Name.
Is there a way of creating a "local" Name reference to a cell or range,
without splitting sheets? It can be very useful, especially in vba!
Best Regards
Mats



  #5   Report Post  
R.VENKATARAMAN
 
Posts: n/a
Default

If I remember correct if you give the range name as
sheet1!rv
it becomes local name in sheet1
if you just give name as
rv
it becomes global

try some experiments.
===============
Mats Samson wrote in message
...
I happened to copy a worksheet with a named range.
Afterwards the named range exists in both sheets as a "local" reference,
i.e. I have the same Name in both sheets and they refer to the same cell

in
the respective sheets. If you look in Insert/Define you'll find a sheet
reference to the current sheet, next to the Name.
Is there a way of creating a "local" Name reference to a cell or range,
without splitting sheets? It can be very useful, especially in vba!
Best Regards
Mats





  #6   Report Post  
Dave Peterson
 
Posts: n/a
Default

And just in case that activesheet name needs to be enclosed in single quotes (if
it contains spaces for example):

Range("A1:B10").Name = "'" & ActiveSheet.Name & "'" & "!myRange"



Bob Phillips wrote:

Mats,

This will create a local name

Range("A1:B10").Name = ActiveSheet.Name & "!myRange"

See also http://www.xldynamic.com/source/xld.Names.html

You might also want to get a copy of Jan Karel Pieterse's N ame Mangaer,
very useful when working with names.
http://www.jkp-ads.com/OfficeMarketPlaceNM-EN.htm

--
HTH

Bob Phillips

"Mats Samson" wrote in message
...
I happened to copy a worksheet with a named range.
Afterwards the named range exists in both sheets as a "local" reference,
i.e. I have the same Name in both sheets and they refer to the same cell

in
the respective sheets. If you look in Insert/Define you'll find a sheet
reference to the current sheet, next to the Name.
Is there a way of creating a "local" Name reference to a cell or range,
without splitting sheets? It can be very useful, especially in vba!
Best Regards
Mats


--

Dave Peterson
  #7   Report Post  
Bob Phillips
 
Posts: n/a
Default

Damn, I thought I had included that!

Bob

"Dave Peterson" wrote in message
...
And just in case that activesheet name needs to be enclosed in single

quotes (if
it contains spaces for example):

Range("A1:B10").Name = "'" & ActiveSheet.Name & "'" & "!myRange"



Bob Phillips wrote:

Mats,

This will create a local name

Range("A1:B10").Name = ActiveSheet.Name & "!myRange"

See also http://www.xldynamic.com/source/xld.Names.html

You might also want to get a copy of Jan Karel Pieterse's N ame Mangaer,
very useful when working with names.
http://www.jkp-ads.com/OfficeMarketPlaceNM-EN.htm

--
HTH

Bob Phillips

"Mats Samson" wrote in message
...
I happened to copy a worksheet with a named range.
Afterwards the named range exists in both sheets as a "local"

reference,
i.e. I have the same Name in both sheets and they refer to the same

cell
in
the respective sheets. If you look in Insert/Define you'll find a

sheet
reference to the current sheet, next to the Name.
Is there a way of creating a "local" Name reference to a cell or

range,
without splitting sheets? It can be very useful, especially in vba!
Best Regards
Mats


--

Dave Peterson



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple Ranges for a Chart Barb R. Charts and Charting in Excel 0 May 31st 05 11:52 PM
Like 123, allow named ranges, and print named ranges WP Excel Discussion (Misc queries) 1 April 8th 05 06:07 PM
Problem with graph ranges No Such Luck Charts and Charting in Excel 6 December 3rd 04 01:09 PM
compare unique identifiers in multiple ranges bawilli_91125 Charts and Charting in Excel 1 November 30th 04 06:34 PM
Named dynamic ranges, copied worksheets and graph source data WP Charts and Charting in Excel 1 November 28th 04 05:19 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"