Find a Named Range programatically using VBA in Excel

  • Thread starter Thread starter todtown
  • Start date Start date
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
 
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
 
Is there a way to cycle through all named ranges? Something like:

For Each NamedRange in NamedRanges

tod
 
Back
Top