Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using dynamic range names in Excel Charts

Status
Not open for further replies.

austen447

Technical User
Oct 25, 2003
4
AU
I want an Excel graph to automatically amend the source range, as the number of data plots in the source range changes. I have a dynamic range name that adjusts to the number of columns in the range, called "graphone" and setup under "insert-name-define" as
=OFFSET(Results!$D$11,0,0,Results!$AA$7,2)
where $aa$7 stores the number of lives column entries in the range.
I can specify this range name when setting up a Chart in Excel 2002, using the "source data" "data range" field.
However, Excel then converts this to a fixed cell range, i.e. if the range definition changes dynamically at a later time, the Excel Chart source data range does not get updated.
Is there a simple way, or another step, to ensure that the graph source data updates dynamically also?
regards
austen447
 
Hi austen447,

I think the following may help assuming that you want to chart all the figures in a range, not just what you want by entering that number in AA7.

Try replacing your Results!$AA7 with the COUNTA function which saves you having to enter in AA7 the number of entries.

=OFFSET(Results!$D$11,0,0,COUNTA($D$11:$D$999)-1,2) assuming D11 is the column header.

If you continue to have problems I can send you an article - "A Dynamic Chart that Plots the Most Recent X Items in a Range " but I will need an email address.

Good Luck!
Peter Moran
Two heads are always better than one!
 
Peter, thanks for the post. I'd be interested in that article; my email is jetset07 at myway.com
my "aa7" cell already contains a COUNTA function set out as you suggest. Thats not the problem - the range does dynamically adjust depending how many entries are there.
The problem is that the Excel Chart does not then reflect the newly adjusted range, since, when you input a range name into the Chart, Excel converts it to a static range reference.
I have done a work-around, in which some VBA code of mine hides the columns with no data - using the fact that an Excel Chart will display only unhidden rows or columns, but this is more cumbersome.
regards
Phil
 
thanks for the post jdhilljr, not quite what I'm wanting to do, but I like the approach which is very user friendly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top