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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Chart - Extending Range

Status
Not open for further replies.

celeron895

Programmer
Jan 29, 2002
81
US
Hello:

I am working with an Excel sheet that is used to produce a chart. I have a macro that inserts a new column into the chart. I then need to add that column into the data that is being represented on the chart. A new column will be inserted each day. Any ideas? I have tried using the seriescollection extend method, but to no avail.
 
Hi
I've just managed to use the following successfully on a simple 1 series bar chart

Sub Add_to_Series()
Dim iCol As Integer
iCol = Worksheets("Sheet1").Range("A1").CurrentRegion.Columns.Count
Sheets("Chart1").Select
ActiveChart.SeriesCollection(1).Formula = _
"=SERIES(,Sheet1!R1C1:R1C" & iCol & ",Sheet1!R2C1:R2C" & iCol & ",1)"
ActiveChart.Deselect
End Sub

;-) If a man says something and there are no women there to hear him, is he still wrong?
"...Three Lions On A Shirt..."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top