Graph Macro

  • Thread starter Thread starter Ben Allen
  • Start date Start date
B

Ben Allen

I have created a macro which produces a graph. It calls a macro which
selects the cells i need, and then creates the graph. How can i make the
line
ActiveChart.SetSourceData Source:=Sheets("GraphTemp").Range("A1:B8"),
PlotBy:= _
xlColumns

Read

ActiveChart.SetSourceData Source:=Sheets("GraphTemp").Range(Selection),
PlotBy:= _
xlColumns

So that the graph is created using the current selection rather than a set
range of cells.
Thanks in advance.
--
Cheers,
Ben

Remove your.tonsils to reply
"You only live once but if you do it right once is enough!"
 
Ben, you are so close:

ActiveChart.SetSourceData Source:=Selection,
PlotBy:=xlColumns

That should do it, I think.
Ken
 

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

Back
Top