I am creating a report template part of which will be generating data charts with a structure similar to a moving average
for this I need to select a range of data i
You have to fully qualify the .Cells
object
Try this
ActiveChart.SetSourceData Source:=Sheets("Weekly Trends").Range(Sheets("Weekly Trends").Cells(x, y), Sheets("Weekly Trends").Cells(k, Z))
You can also make the above code short
With Sheets("Weekly Trends")
ActiveChart.SetSourceData Source:=.Range(.Cells(x, y), .Cells(k, Z))
End With