Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
bobf
 
Posts: n/a
Default dynamic range for excel chart

Hi all,
Does anyone know how I can set an EXCEL chart data range
to automatically adjust to the number of rows in my data,
which both increases and decreases over time. I can use
the COUNT function to determine the current number of
rows, but I don't know if I am allowed formulas in a
chart's data range.

thanks in advance.
  #2   Report Post  
David Jessop
 
Posts: n/a
Default

Hi,

One way to do this is to use the OFFSET function. For example (from a SS
I'm using)

=OFFSET(Europe!$J$1,0,0,COUNT(Europe!$J:$J),1)

This gives you a range that changes size depending on the number of entries
in the J column. You'll have to play a little with the exact formula.
Annoyingly this doesn't work in SERIES, so we just use this function to
create a named range (Insert, Name, Define) for the X and Y values and then
in the macro call:

Sheets("Chart").Select
ActiveChart.SetSourceData _
Source:=Sheets("Europe").Range("DATE,Earnings_Yiel d"), _
PlotBy:=xlColumns

You could either have the macro run on opening the SS, or just add a button
which shows the chart (i.e. just switches to that tab), but runs the update
first.

HTH,

David Jessop

"bobf" wrote:

Hi all,
Does anyone know how I can set an EXCEL chart data range
to automatically adjust to the number of rows in my data,
which both increases and decreases over time. I can use
the COUNT function to determine the current number of
rows, but I don't know if I am allowed formulas in a
chart's data range.

thanks in advance.

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
Dynamic charting problems (events) [email protected] Charts and Charting in Excel 4 January 27th 05 09:32 PM
Add up a Dynamic Range with 2 Variables John Excel Worksheet Functions 1 January 15th 05 02:23 PM
Dynamic Range Problem [email protected] Excel Discussion (Misc queries) 4 January 4th 05 06:55 PM
Add a Dynamic Range with 2 Conditions Q John Excel Worksheet Functions 7 December 23rd 04 02:58 PM
named range refers to: in a chart Spencer Hutton Excel Discussion (Misc queries) 1 December 14th 04 10:15 PM


All times are GMT +1. The time now is 04:19 AM.

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"