PC Review


Reply
Thread Tools Rate Thread

Changing a named range within a formula

 
 
Mark b.
Guest
Posts: n/a
 
      18th Feb 2009
I'm trying to set up a macro that will update the reference to a anamed range
within a formula.

For example, cell A1 contains a value of "LastName" which also happens to be
a named range.

Cell B1 contains the formula "=Count(LastName)"

When I change the value of A1 to the name of another named range, i.e.
"Address", and run the code, I want the formula in B1 to change to
"=Count(Address)"

Ideas?
--
Thanks,
Mark
 
Reply With Quote
 
 
 
 
Chip Pearson
Guest
Posts: n/a
 
      18th Feb 2009

Create a name called, for example, CountRange and assign it to
=COUNT(INDIRECT($A$1))

Then call it from a cell with

=CountRange

It will return the COUNT of the range whose name appears in cell A1.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Wed, 18 Feb 2009 13:19:02 -0800, Mark b.
<(E-Mail Removed)> wrote:

>I'm trying to set up a macro that will update the reference to a anamed range
>within a formula.
>
>For example, cell A1 contains a value of "LastName" which also happens to be
>a named range.
>
>Cell B1 contains the formula "=Count(LastName)"
>
>When I change the value of A1 to the name of another named range, i.e.
>"Address", and run the code, I want the formula in B1 to change to
>"=Count(Address)"
>
>Ideas?

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
changing font color in named range using vba punking315 Microsoft Excel Programming 3 5th Feb 2009 02:18 PM
RE: changing font color in named range using vba Mike H Microsoft Excel Programming 0 5th Feb 2009 12:44 PM
Changing graph axes using named range simon.stewart@uk.fid-intl.com Microsoft Excel Programming 1 5th Apr 2007 05:08 PM
Changing graph axes using named range simon.stewart@uk.fid-intl.com Microsoft Excel Charting 2 5th Apr 2007 03:51 PM
Array as a "named range" - formula ok in cells, but error as "named range" tskogstrom Microsoft Excel Misc 11 28th Dec 2006 04:44 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:00 AM.