Hi,
What Goeff is referring to is Named Ranges. He has given you a code segment for giving a range a Name. If you use that Name in your Source Data definition, then, whenever your data range changes, and you run that code, the Name adjusts to the range and your graph will point to that range.
Now I might do it a bit differently. I am assuming that your data has headings in row 1. I like to use (and record for programatic use) Insert/Name/Create/Create names in top row. Now each column of data has the name that is in the heading at the top of that column. Record this and use it in step 5 following. Here's how I recorded and modified it...
Code:
Sub AdjustNameRanges()
Application.DisplayAlerts = False
[A1].CurrentRegion.CreateNames _
Top:=True, Left:=False, Bottom:=False, Right:=False
Application.DisplayAlerts = True
End Sub
2. Right click the chart and select Source Data... for the popup.
3. On the Series Tab, for each series, replace the Values: with...
=
then click on the sheet tab
then type the column name in Values:
repeat for each series
4. For Category X labels do the same thing using the column name for your x axis values
5. Now you are all set. Add a few rows to the source data. Run the macro you recorede in step 1 and VOLA!
Hope this helps Skip,
metzgsk@voughtaircraft.com