ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Adjust charts dynamically (https://www.excelbanter.com/excel-programming/371576-adjust-charts-dynamically.html)

Nicolas Roth

Adjust charts dynamically
 
Hello,
I would like to adjust dynamically a chart. In order to this, I was
hoping to be able to do something like this:

With ActiveChart.SeriesCollection.NewSeries
.Name = Sheets("Information").Range("B1")
.Values = Sheets("Data Streams").Range("e1:e200")
.XValues = Sheets("Data Streams").Range("b1:b20")
End With

which works. However, every time a new point is entered, it increases
the range. i.e. from e1:e201, etc.
I tried this:
..Values = Sheets("Data Streams").Range(cells(1,5),cells(nb,5))

where nb is defined as the number of rows with data. However, this does
not work. Any idea how I could make this?
Thanks, Nicolas



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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com