Name Cells???

buzz71023

Active Member
Joined
May 29, 2011
Messages
295
Office Version
  1. 2016
Platform
  1. Windows
Does anyone know if it is possible to have two cells/Ranges named the same thing in one Workbook (Two different Sheets)? If so how might I accomplish that.

I want Cell "D1" on Sheet1 to be named "Test"
and Cell "T17" on Sheet2 to be named "Test" as well.

this doesn't have to be done in VBA, I will just help reduce several of my codes if I can get them named the same thing.
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Hello
That's possible. When creating the named range (for instance, Ctrl-F3), indicate that you want a sheet level named range. (As opposed to the default Workbook-level named range).

Hence, you choose a name on a smaller scope.
 
Upvote 0
In the Define Name-->New dialog there's a Scope selection where you can limit a named range to a specific worksheet.

HTH,
 
Upvote 0
Never mind I think I figured it out... If there is a way to do in in VBA I wouldnt mind knowing that for future ref.
 
Upvote 0
Never mind I think I figured it out... If there is a way to do in in VBA I wouldnt mind knowing that for future ref.

For named ranges with a global (workbook) scope, the VBA command is:

Code:
ActiveWorkbook.Names.Add Name:="...", RefersToR1C1:="..."

For named ranges with a local (worksheet) scope, the VBA command is similar but you add the worksheet name:

Code:
ActiveWorkbook.Worksheets("Sheet1").Names.Add Name:="...", RefersToR1C1:="..."

Of course, ActiveWorkbook or worksheet references could be different. As long as you have valid workbook and/or worksheet references, you can add a member to the resp. Names collection.
 
Upvote 0
yeah I was going to just record the macro but the codes are usually much longer than someone with experience.
 
Upvote 0

Forum statistics

Threads
1,223,244
Messages
6,170,976
Members
452,372
Latest member
Natalie18

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top