Thread: Named Ranges
View Single Post
  #23   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Named Ranges - my discovery

Just this portion:

If Dave remembers the details of the problem of !$A$1 in the future, I am sure
we are interested.

I can't imagine that happening <bg. But I can imagine someone posting the
reason independent of my memory!

Epinn wrote:

Thank you all for your input and guidance. Special thanks to Dave and Roger who help switch on the light. Glad Roger appears to know how my brain is wired; Boolean is a good example. I really needed his explanation on apostrophe. Last but not least, I found Dave's suggested experiment inspiring.

I made a discovery with the experiment. There is another situation (other than having *spaces* in the sheet name) that Excel will insert the apostrophes. Do you want to guess what it is before you read on?

Excel doesn't allow the following characters as part of the sheet name.

: ? / \[ ] *

But it allows exclamation mark(s) i.e. ! as part of a sheet name.

If I name my sheet

! or dupcopy! or my!!!copy

Excel will include the apostrophes even though there are *no* spaces. It makes sense. Can you imagine if there are no ' ', but on the other hand, users probably won't use !!! in a sheet name; only someone like me in a testing environment ...... Please stay tuned for more discoveries in the future. ;)

Thanks again. It has been educational. If Dave remembers the details of the problem of !$A$1 in the future, I am sure we are interested.

I think I can put this thread to bed now. zzzzzzz You are welcome to continue to contribute. (A few bed time stories won't hurt.)

Epinn






"Dave Peterson" wrote in message ...
And just to add to Roger's response.

Create a new workbook with two worksheets: Name them Sheet1 and Sheet2.

In A1 of Sheet1, put this formula:
=sheet2!a1

Now rename sheet2 a few times. Name it "Sheet 2", name it "Sheet 99", name it
"1234", name it "Epinn's Sheet"

Look at the formula after each rename.

Epinn wrote:

Finally, I think the light bulb is ___! Glad Roger understood my question and that the dialogue between Dave and Roger helped me sort out a few things. Yes, how do we define "same name?" I'll leave it for another day. The important thing here is I am quite clear now on how to define names.



Yesterday, I said, "Jim and Biff gave me the answer." Today, I said, "Dave and Pete gave me the answer yesterday as well." Sorry for the delay. It took me a while to grasp what you were trying to tell me. I did read about qualifying the range name by the sheet. Unfortunately, I had a different frame of reference. I focused on the bottom part of the "define name" dialogue box which is "Refers to" while you referred to the top part of the dialogue box "Names in workbook." I didn't know that I had to actually key in "Sheet2!" as part of the name. This is why I told you I had no luck using the same name via insertnamedefine etc.



Now I have a question on apostrophes.



If I do ctrl+drag of a sheet tab that contains a named range and if I *rename* the duplicate (new) sheet, (e.g. newcopy) then there won't be apostrophes around the sheet name (newcopy) in the define name dialogue box. But if I don't rename the duplicate sheet, say I keep sheet 1(2) as the name, then there will be apostrophes around the sheet name in the define name dialogue box; e.g. 'sheet 1(2)'



I find this confusing.



Dave, you included the following in your posts.



=sheet1!ABC+'sheet 99'!ABC




'sheet 99'!ABC (notice the apostrophes)




Yes, I pay attention to the apostrophes but I don't understand why sheet99 has apostrophes and sheet1 doesn't. When I include the sheet name without apostrophes, everything seems to work fine as well. Do I really need apostrophes? I am missing something here.



Please help.



Epinn

"Dave Peterson" wrote in message ...
I think you're in the minority here.

But it does prove that it's good to specify what you mean if there's any doubt.

Roger Govier wrote:

do they share the same name?

Not if they rely on Sheet(n)! in front of them to operate, IMO.

--
Regards

Roger Govier

"Dave Peterson" wrote in message
...
I guess it boils down to what you consider the name.

If you create a worksheet level name on Sheet1 named ABC and another
worksheet
level name on Sheet2 also named ABC, do they share the same name?



Roger Govier wrote:

Hi Dave

Quite right, but in my eyes those are different named ranges.
Epinn was asking about the same name - which is what I was
answering -
and in that case you cannot use the same name to point to 2 different
ranges.

--
Regards

Roger Govier

"Dave Peterson" wrote in message
...
If you include the sheet name in the definition, you can have sheet
level names
that all use that same ABC name.

While on Sheet1:
Insert Name|Define
Names in workbook: sheet1!ABC
refers to: $a$1

While on Sheet 99 (notice the space):
Insert Name|Define
Names in workbook: 'sheet 99'!ABC (notice the apostrophes)
refers to: $C$12 (it can refer to the same
address
or not)

I can refer to those range names on sheet7653 by:
=sheet1!ABC+'sheet 99'!ABC

And it'll work fine.



Roger Govier wrote:

Hi Epinn
Can someone confirm this is not possible please?

That is correct.
You can't have the same name for 2 different ranges, either on the
same
sheet or different sheets.

You can have the same range on multiple sheets adopt the same name
provided there is only an exclamation "!" in front of the range,
not
Sheet!

--
Regards

Roger Govier

"Epinn" wrote in message
...
Thank you all for your response. What I want is very simple,
nothing
to
do with VBA.

Basically, I was trying to have the *same name* for A1:A10 on two
sheets
(within the same workbook) respectively. Jim and Biff gave me the
answer.

I don't think I can name A1:A10 on Sheet1 as "ABC" and then also
name
B1:B10 on Sheet2 as "ABC" as well. I used insertnamedefine and
I
also
use the Sheet# to qualify the range, but no luck.

Can someone confirm this is not possible please?

The Name Manager may come in handy one of these days. Thanks
Dave.

Epinn

"Epinn" wrote in message
...
Note: This is a continuation of a previous discussion which you
don't
really need.

Dave,

I did an experiment. I opened a brand new workbook. On Sheet1, I
selected A1:A10 and defined it with a name "Range123." Then, on
Sheet2,
I did the same. As soon as I did that, "Range123" from Sheet1 no
longer
existed. So, I don't really understand how the user can have the
same
named ranges within one workbook? You know what, I even took out
the
reference to Sheet and tried to force in just the cell reference;
but
Excel won't let me. What am I missing here? Wonder if *two*
workbooks
are involved when we talk about "same name?"

Sounds like you were talking about VBA. I didn't pick this up.

Look forward to your comments.

Epinn

--

Dave Peterson

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson