ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Catch name of range (https://www.excelbanter.com/excel-programming/411199-catch-name-range.html)

steven

Catch name of range
 
If a user choses a range in the Name Box is there a way to catch that range
in a variable after selected?

Thank you,

Steven

JLGWhiz

Catch name of range
 
What do you mean by choosing a range in the Name Box?

You can set a named range to a variable just like any other range.

Set myVar = Range("myNamedRange")

See VBA help titles Referring to Named Ranges





"Steven" wrote:

If a user choses a range in the Name Box is there a way to catch that range
in a variable after selected?

Thank you,

Steven


steven

Catch name of range
 
The Name Box to the left of the Formula Bar. If the user selects a range
from the Name Box I want to catch the name in a variable.

"JLGWhiz" wrote:

What do you mean by choosing a range in the Name Box?

You can set a named range to a variable just like any other range.

Set myVar = Range("myNamedRange")

See VBA help titles Referring to Named Ranges





"Steven" wrote:

If a user choses a range in the Name Box is there a way to catch that range
in a variable after selected?

Thank you,

Steven


Gary Keramidas

Catch name of range
 
if they've actually clicked it to select the range:

rngname = selection.name.name

--


Gary


"Steven" wrote in message
...
If a user choses a range in the Name Box is there a way to catch that range
in a variable after selected?

Thank you,

Steven




Bob Phillips

Catch name of range
 
Try

Selection.Name.Name

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Steven" wrote in message
...
The Name Box to the left of the Formula Bar. If the user selects a range
from the Name Box I want to catch the name in a variable.

"JLGWhiz" wrote:

What do you mean by choosing a range in the Name Box?

You can set a named range to a variable just like any other range.

Set myVar = Range("myNamedRange")

See VBA help titles Referring to Named Ranges





"Steven" wrote:

If a user choses a range in the Name Box is there a way to catch that
range
in a variable after selected?

Thank you,

Steven





All times are GMT +1. The time now is 10:44 AM.

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