Defining Variables with Same Name in Different Worksheets

M

mhyzak

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.
 
R

Ragdyer

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top