View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.charting
Greg Wilson
 
Posts: n/a
Default extending source data in several charts

I suggest using Dynamic Named Ranges. Debra Dalgleish discusses these he

http://www.contextures.com/xlNames01.html

Dynamic Named Ranges use worksheet functions (particularly the Offset
function) in the range's RefersTo property to enable automatic adustment of
the range definitions - i.e. they update automatically. Once established,
they should be maintenance free.

The example below assumes the chart is XY Scatter. Also assumed is that the
sheet is named "Sheet1" and that the x values are in column A starting in A1
and the y values are adjacent in column B. Also required for the example is
that there be no other data in these columns.

Example:
1. Open the Define Name dialog: Insert Names Define
2. Create the x values range:
i. In the "Names in workbook:" window enter the name "XVals"
ii. In the "Refers to:" window enter the following formula:
=OFFSET(Sheet1!$A$1, 0, 0, COUNT(Sheet1!$A:$A), 1)
iii. Click the Add button
3. Now create another range for the y values:
i. In the "Names in workbook:" window enter the name "YVals"
ii. In the "Refers to:" window enter:
=Offset(XVals, 0, 1)
iii. Click the Add button
4. Click the Close button
5. Now change the chart's source data to reference these names:
i. Right-click the chart and select Source Data
ii. Select the Series tab (if not already active)
iii. Ensure that "Series1" is selected in the "Series" window
iv. In the "X Values:" window enter: =Sheet1!XVals
v. In the "Y Values:" window enter: =Sheet1!YVals

The Copy and Paste functions are not available when either the Define Names
and Source Data dialogs are active. To copy use:
<Ctrl + C
To paste use:
<Ctrl + V

Regards,
Greg


"Mike" wrote:

I have a big Excel doc with numerous charts, each with numerous lines.

About once per month, I need to extend the charts for about a month. This is
a very painful process for each graph (multiplied by numerous graphs!).

Does anyone have any simple method to do a mass change, standard or VBA?
This would be extremely helpful.

I also noticed some posts using OFFSET, but this would be too confusing for
my father (for whom I am doing this) and too cumbersome. Something like a
standard function or a VBA macro that I can program would make his life so
much easier.

Thanks much!