graph range update from macro

R

rick_mc

Hi,

I have the following statements in my macro. I need to update the graph
range for a new row, but don't know how to use the rng.row data in the graph
Range section to replace "A2:A27,F2:G27" with something like
"A2:A"rng.row,"F2:G"rng.row. Can someone give me an example?

Dim rng As Range
Set rng = Cells(Rows.Count, 1).End(xlUp)

ActiveChart.SetSourceData Source:=Sheets("Data").Range("A2:A27,F2:G27")

ActiveChart.SeriesCollection(1).XValues = "=Data!R3C1:R27C1"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top