Named Ranges
Hi Epinn
If there are any spaces in a sheet name, apostrophe's must be used.
If there no spaces, apostrophe's are not essential but cause no problem
if they are included when typing a formula.
Even if you include them when you create a named range on sheet1 which
referred to say 'Sheet1'!$A$1:$G$20, then Excel removes them and stores
it as Sheet1$A$1:$G$20.
If you then rename sheet1 to My Sheet, Excel will automatically insert
them when it carries out the internal renaming and you will see 'My
Sheet'!$A$1:$G$20 as the new range when you look at named ranges.
When you type a range in a formula, as opposed to referring to its name,
then you MUST use apostrophe's when referring to the sheet name it there
are spaces, otherwise the formula will fail.
--
Regards
Roger Govier
"Epinn" wrote in message
...
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
|