ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Replace Data Source of a Chart (https://www.excelbanter.com/excel-programming/274132-replace-data-source-chart.html)

[email protected]

Replace Data Source of a Chart
 
Hi,

Is there a fast way to find the data source in a number of charts and
replace that (w/o going to the data source window and edit)with a new
data source( especialy for chats coppied from another sheet where they
keep their link to the original sheet)

steve

Replace Data Source of a Chart
 
One approach is to use Defined Names in your chart series.

instead of Sheet1!A1:A15 use
Sheet1!myrange

than in your code you can use:
ActiveWorkbook.Names.Add Name:="myrange", _
RefersTo:="=Sheet1!A1:A15"

Now just let your code change the range reference and your chart will
change.

steve

wrote in message
om...
Hi,

Is there a fast way to find the data source in a number of charts and
replace that (w/o going to the data source window and edit)with a new
data source( especialy for chats coppied from another sheet where they
keep their link to the original sheet)





All times are GMT +1. The time now is 01:27 PM.

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