Good day everyone,
Looking to get your advice on how to move forward. I'm trying to update a chart's source data after being copied to a new worksheet using the macro below. I would like to set the new data source using an offset from the chartobject itself. Here's what I have below:
Not sure why the last line keeps giving me: Application-defined or object-defined error. Any ideas?
Dim TopLeftCell As Range
Worksheets("Sheet2").Activate
ActiveSheet.ChartObjects(1).Activate
ActiveSheet.ChartObjects(1).TopLeftCell.Select
Set TopLeftCell = ActiveCell
ActiveSheet.ChartObjects(1).Activate
ActiveChart.SetSourceData source:=Range(TopLeftCell.Offset(-4, 0), TopLeftCell.Offset(-1, 6))
Looking to get your advice on how to move forward. I'm trying to update a chart's source data after being copied to a new worksheet using the macro below. I would like to set the new data source using an offset from the chartobject itself. Here's what I have below:
Not sure why the last line keeps giving me: Application-defined or object-defined error. Any ideas?
Dim TopLeftCell As Range
Worksheets("Sheet2").Activate
ActiveSheet.ChartObjects(1).Activate
ActiveSheet.ChartObjects(1).TopLeftCell.Select
Set TopLeftCell = ActiveCell
ActiveSheet.ChartObjects(1).Activate
ActiveChart.SetSourceData source:=Range(TopLeftCell.Offset(-4, 0), TopLeftCell.Offset(-1, 6))