Replace Data Source of a Chart

  • Thread starter Thread starter aalwazeer
  • Start date Start date
A

aalwazeer

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)
 
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
 
Back
Top