Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Find a Named Range programatically using VBA in Excel

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Find a Named Range programatically using VBA in Excel

dim str as string

str = range("Investments").address
msgbox str
--
HTH...

Jim Thomlinson


"todtown" wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Find a Named Range programatically using VBA in Excel

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

For Each NamedRange in NamedRanges

tod

On Feb 21, 4:48*pm, Jim Thomlinson <James_Thomlin...@owfg-Re-Move-
This-.com wrote:
dim str as string

str = range("Investments").address
msgbox str
--
HTH...

Jim Thomlinson



"todtown" wrote:
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- Hide quoted text -


- Show quoted text -


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 419
Default Find a Named Range programatically using VBA in Excel

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




"todtown" wrote in message
...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 - Find formulas that use a named range Office Productivity Consultant Excel Discussion (Misc queries) 0 October 19th 09 11:17 PM
Find Row in a named range Raul Excel Worksheet Functions 3 November 24th 07 12:41 AM
Find Cell in Named Range David Excel Worksheet Functions 3 May 8th 07 06:00 AM
find within a named range, then deselect the range Bob Mouldy Excel Programming 4 August 23rd 06 02:48 PM
How to find all formulas that used a certain named range Laurence Lombard Excel Discussion (Misc queries) 2 October 25th 05 08:15 AM


All times are GMT +1. The time now is 05:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"