close

Does anyone know how to create one named reference across multiple
worksheets in the same workbook (BUT, not for the same cell reference
in each worksheet).
For example, the reference of TOTAL that could apply to cell A10 in
worksheet1, but A13 in worksheet2.
I know there is a way because I have inadvertantly done it for one
reference, I now need to replicate this and don't know how!

Please help--
ajames
------------------------------------------------------------------------
ajames's Profile: www.excelforum.com/member.php...oamp;userid=31502
View this thread: www.excelforum.com/showthread...hreadid=526053If I'm understanding you right, in the Insert Names Define Dialog, where it
asks you for the name, enter the full sheet refernce and the name eg 'Sheet
1'!TOTAL
That allows you to have the same name on different worksheets. Formulas on
that sheet will only see the range on that sheet, not others. Formulas on
sheets without the name will either see the quot;globalquot; name (that appears in
the names dialog when you're in any worksheet, and doesn't show a sheet name
against it), or if there isn't one, will return a #NAME? error

BrianH

quot;ajamesquot; wrote:

gt;
gt; Does anyone know how to create one named reference across multiple
gt; worksheets in the same workbook (BUT, not for the same cell reference
gt; in each worksheet).
gt; For example, the reference of TOTAL that could apply to cell A10 in
gt; worksheet1, but A13 in worksheet2.
gt; I know there is a way because I have inadvertantly done it for one
gt; reference, I now need to replicate this and don't know how!
gt;
gt; Please help
gt;
gt;
gt; --
gt; ajames
gt; ------------------------------------------------------------------------
gt; ajames's Profile: www.excelforum.com/member.php...oamp;userid=31502
gt; View this thread: www.excelforum.com/showthread...hreadid=526053
gt;
gt;


Thanks for your response, but unfortunately this does not work. If I
call cell A10 in Sheet1 quot;TOTALquot; and then go to Sheet2, click on A13 and
try and define it as quot;TOTALquot;, the named reference comes up as
Sheet1!A10, I can override it to Sheet2!A13, but then it doesn't work
for Sheet1 anymore!
The one where I have managed to do it correctly for (Somehow), when I
go into the Define Name box, the list of current names shows up in the
second box as normal, but there seems to be a second column in that box
which states the worksheet that the name applies to.--
ajames
------------------------------------------------------------------------
ajames's Profile: www.excelforum.com/member.php...oamp;userid=31502
View this thread: www.excelforum.com/showthread...hreadid=526053You need to put the sheet name in front of the RANGE NAME, as per my previous
response, not just in front of the cell reference. If there is no sheet name
in front of the range name, it is quot;seenquot; from anywhere in the workbook, so
hence the behaviour you describe if you simply change the sheet and cell
referenced by an unqualified range name.

If you create a range name on a sheet, and then copy the sheet, the original
sheet will contain the cells refernced globally - ie quot;seenquot; from anywhere in
the workbook, and the copied sheet will now contain a local version of the
range name, seen only by formulas on that sheet, or by formulas elsewhere
that use the full sheet reference plus range name. Depending where your
formulas referncing only the range name without a sheet name qualifier are,
they'll pick up one or the other - can be dangerous, care required!

BrianH

quot;ajamesquot; wrote:

gt;
gt; Thanks for your response, but unfortunately this does not work. If I
gt; call cell A10 in Sheet1 quot;TOTALquot; and then go to Sheet2, click on A13 and
gt; try and define it as quot;TOTALquot;, the named reference comes up as
gt; Sheet1!A10, I can override it to Sheet2!A13, but then it doesn't work
gt; for Sheet1 anymore!
gt; The one where I have managed to do it correctly for (Somehow), when I
gt; go into the Define Name box, the list of current names shows up in the
gt; second box as normal, but there seems to be a second column in that box
gt; which states the worksheet that the name applies to.
gt;
gt;
gt; --
gt; ajames
gt; ------------------------------------------------------------------------
gt; ajames's Profile: www.excelforum.com/member.php...oamp;userid=31502
gt; View this thread: www.excelforum.com/showthread...hreadid=526053
gt;
gt;


Brian,

I'm really sorry, but I don't understand what you mean.

I have gone in to Insert, Name, Define and inserted the name TOTAL. In
the Refers to box I have the text =Sheet1!$Aamp;10

If I then go to Sheet2 and try and create the name TOTAL again, it just
brings up the original one. If I override the Refers to box with, for
example, =Sheet2!$A$12 - then the name does not work for the first
sheet anymore.

I am trying to use this in a macro whereby if they run the macro on
Sheet1 - it will go to the named range TOTAL (A10), but if they run the
macro when they are on Sheet2 then it will go to the named range TOTAL
(A12).

I would really appreciate it if you could explain to me exactly what I
need to do differently.

Thanks--
ajames
------------------------------------------------------------------------
ajames's Profile: www.excelforum.com/member.php...oamp;userid=31502
View this thread: www.excelforum.com/showthread...hreadid=526053Go to Insert, Name, Define and enter 'Sheet1'!TOTAL in the Names box above
the list (the apostrophes are required if you have spaces or other special
characters in your sheet name, but are optional in this particular case), and
whatever cell reference you want in the Refers to box - Sheet1!$A$10 in your
case. You will see Sheet1 appear to the right of the TOTAL name in the
dialog box when you reopen it while you're on that sheet.

Similarly for Sheet2, and so on.

Now formulas on those sheets that reference TOTAL will pick up the value
from the same sheet, and macros will refer to the TOTAL cell on the active
worksheet.

If you have a name that shows TOTAL without a sheet name - entered as per
your current process - entering a formula on a sheet that doesn't have it's
own TOTAL will pick up that value, wherever it is. If you don't have a
quot;globalquot; TOTAL, a formula will generate a #NAME? error, and your macro will
generate a run time error. You can even have the quot;globalquot; named cell and a
sheet specific cell with the same name on the one sheet and they can be the
same or different cells! Formuals on that sheet see the local sheet-specific
name, not the global name.

You can however refernce a sheet range name from elsewhere by putting the
full sheet refernce in the formula (=Sheet1!TOTAL), from anywhere in this (or
any other) workbook, and in a macro by Worksheets(quot;Sheet1quot;).Range(quot;TOTALquot;)

I haven't been able to work out how you can access the quot;globalquot; name by
formula or macro from a sheet with a quot;localquot; name. If for some reason you
need to do that, at present I'd have to say use a different name.

Cheers

BrianH
quot;ajamesquot; wrote:

gt;
gt; Brian,
gt;
gt; I'm really sorry, but I don't understand what you mean.
gt;
gt; I have gone in to Insert, Name, Define and inserted the name TOTAL. In
gt; the Refers to box I have the text =Sheet1!$Aamp;10
gt;
gt; If I then go to Sheet2 and try and create the name TOTAL again, it just
gt; brings up the original one. If I override the Refers to box with, for
gt; example, =Sheet2!$A$12 - then the name does not work for the first
gt; sheet anymore.
gt;
gt; I am trying to use this in a macro whereby if they run the macro on
gt; Sheet1 - it will go to the named range TOTAL (A10), but if they run the
gt; macro when they are on Sheet2 then it will go to the named range TOTAL
gt; (A12).
gt;
gt; I would really appreciate it if you could explain to me exactly what I
gt; need to do differently.
gt;
gt; Thanks
gt;
gt;
gt; --
gt; ajames
gt; ------------------------------------------------------------------------
gt; ajames's Profile: www.excelforum.com/member.php...oamp;userid=31502
gt; View this thread: www.excelforum.com/showthread...hreadid=526053
gt;
gt;


You are an absolute star!--
ajames
------------------------------------------------------------------------
ajames's Profile: www.excelforum.com/member.php...oamp;userid=31502
View this thread: www.excelforum.com/showthread...hreadid=526053My pleasure

Cheers

quot;ajamesquot; wrote:

gt;
gt; You are an absolute star!
gt;
gt;
gt; --
gt; ajames
gt; ------------------------------------------------------------------------
gt; ajames's Profile: www.excelforum.com/member.php...oamp;userid=31502
gt; View this thread: www.excelforum.com/showthread...hreadid=526053
gt;
gt;

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()