ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Defining Variables with Same Name in Different Worksheets (https://www.excelbanter.com/excel-discussion-misc-queries/141496-defining-variables-same-name-different-worksheets.html)

mhyzak

Defining Variables with Same Name in Different Worksheets
 
In a workbook with multiple worksheets, is it possible to define a name that
only applies to that particular worksheet? I would like to use the same
variable name on another worksheet, but for a different set of cells. I had
copied a worksheet to another worksheet in the workbook, and it seemed to do
this for some variable, but not all of them. Where would I enter the
information that indicates a particular variable name only applies to a
specific worksheet.

RagDyeR

Defining Variables with Same Name in Different Worksheets
 
You have to prefix the range name with the sheet name followed with an
exclamation point.

For example:

Select the range,
Click in the name box (left of the formula bar),
Type:
sheet1!mylist
And hit <Enter

Go to Sheet2, select your range for that sheet, and do the same thing:
sheet2!mylist

Now, when you go to:
<Insert <Name <Define

You'll see the range name on the left side, and the sheet name on the right
side of the "Define Name" window.


--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"mhyzak" wrote in message
...
In a workbook with multiple worksheets, is it possible to define a name
that
only applies to that particular worksheet? I would like to use the same
variable name on another worksheet, but for a different set of cells. I
had
copied a worksheet to another worksheet in the workbook, and it seemed to
do
this for some variable, but not all of them. Where would I enter the
information that indicates a particular variable name only applies to a
specific worksheet.





All times are GMT +1. The time now is 03:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com