Hello I am trying to use a variable in a source range to create a chart. Basically if more data is added i would like my chart to adapt. I used the variable last row and I put it in the source range but I am getting a syntax error
LastRow = d_paste.Cells(d_paste.Rows.Count, "A").End(xlUp).Row
ActiveSheet.Shapes.AddChart.Select
ActiveChart.SetSourceData Source:=Range("'Runtime Graphs'!$A$4:"$A$" & LastRow,'Runtime Graphs'!$D$1:"$D$" & LastRow")
Thanks in advance for the feedback
LastRow = d_paste.Cells(d_paste.Rows.Count, "A").End(xlUp).Row
ActiveSheet.Shapes.AddChart.Select
ActiveChart.SetSourceData Source:=Range("'Runtime Graphs'!$A$4:"$A$" & LastRow,'Runtime Graphs'!$D$1:"$D$" & LastRow")
Thanks in advance for the feedback