Forum Discussion
AmyM-NirR
Jan 17, 2022Copper Contributor
Copying sheet with dynamic chart
Excel 365 Suppose I use the method of defining dynamic arrays as a named range, and then use that named range in a chart (thus allowing it to expand or shrink to the true size of the dynamic array) ...
Ihabmalaeb
Feb 07, 2022Copper Contributor
Dear,
I was facing the same issue. Unfortunately, the only way is using macros and I created the following code and it worked well:
With ActiveSheet
With ActiveSheet.ChartObjects(1).chart
Set srsNew = .SeriesCollection.NewSeries
With srsNew
.Values = ("'" & ActiveSheet.Name & "'" & "!YDATA")
.XValues = ("'" & ActiveSheet.Name & "'" & "!XDATA")
'YDATA and XDATA are the names of your named range
End With
End With
End With