Find a Named Range programatically using VBA in Excel

T

todtown

Here's an easy one for somebody. I have several named ranges on a
worksheet. Each named range represents a cell where I want to put the
results of a query. For example, if I have a range named "Investments"
somewhere on the sheet, and that range represents cell C25. What code
could I use to return the range address for the given named range?
Sounds easy just typing it, but I guess I just don't have the book
learnin' for such things. <g>

tod
 
C

Conan Kelly

todtown,

Debut.Print Range("Investments").Address

or

MsgBox Range("Investments").Address

Look up the Address property (as it applies to a range object) in XL's VBA
Help to see what all the arguments are, so you can adjust the output as
necessary.

HTH,

Conan
 
T

todtown

Is there a way to cycle through all named ranges? Something like:

For Each NamedRange in NamedRanges

tod
 

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