ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA Excel Charts (https://www.excelbanter.com/excel-programming/273700-re-vba-excel-charts.html)

Tom Ogilvy

VBA Excel Charts
 
Easier would be to use dynamic defined names to be the source of your data

Insert =Name = Define

Name: XValues
Refersto: =Offset(Sheet1!$A$1,0,0,Count(Sheet1!$A$A),1)

Name: YValues
Refersto: =Offset(Sheet1!$B$1,0,0,Count(Sheet1!$B$B),1)

In the Chart wizard, under data source, for the series specify (or edit this
in the menu when right clicking on the chart)

=WorkbookName.xls!YValues

and for labels
=WorkbookName.xls!XValues

or edit it in the formula bar when selecting the series.

Thus no code needed.

Regards,
Tom Ogilvy



"jNando" wrote in message
...
I have an Excel workbook that has many charts in it. I
would like to create some code that allows me to
automatically manipulate the .Value and .Xvalue of the
active chart's SeriesCollection.
Each month a new data point is added to the chart's source
data and the .Value and .XValue needs to be extended by
one column to the left (the source data is in rows) to
encompass the new data point. Does anyone have an example
of code that could do this?

Thanks,
jNando





All times are GMT +1. The time now is 12:00 AM.

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