Get ActiveCell Name in VBA

BAlGaInTl

Well-known Member
Joined
May 7, 2003
Messages
1,082
Ok...

I'm actually working on another problem, and I thought I had the solution...

Let's say that I have named range A1 something like "Name01" for easy access in formulas.

Is there any way to return that Value by VBA?

If I use:

ActiveCell.Name or Selection.Name, I get the full "=Sheet1!$A$1" instead.

Any thoughts are appreciated.
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Like this, for example?

Code:
Debug.Print Range("Name01").Name.Name
 
Upvote 0
Glad to help. Yes, it looks a little odd, but the range object's name property returns a Name Object. The Name Object also has a name property, which is what we use to get its name.

HTH,
Colin
 
Upvote 0

Forum statistics

Threads
1,223,639
Messages
6,173,499
Members
452,517
Latest member
SoerenB

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