Graphing with NAMED RANGES - VBA II

Terry_Orange

Board Regular
Joined
Jul 22, 2002
Messages
133
Please ignore the last post !

Having established how to construct a graph with a named range, can anyone give me advice on how to use more than one range in a graph.

ie.

ActiveChart.SetSourceData Source:=myRange1, PlotBy:=xlRows

WORKS.

but if I want more than one range in my source

ActiveChart.SetSourceData Source:=(myRange1,myRange2,myRange3), PlotBy:=xlRows

DOESN'T WORK.

Anyone any ideas ???
Nick.
This message was edited by Terry_Orange on 2002-10-03 07:20
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Hi Nick,

I believe you should be able to use square brackets:

ActiveChart.SetSourceData Source:=[myRange1,myRange2,myRange3], PlotBy:=xlRows

so long as the three ranges are all on the active worksheet. The square brackets are just a shorthand alternative to

Range("myRange1,myRange2,myRange3")

to return a range object that includes all three ranges.

Damon
 
Upvote 0

Forum statistics

Threads
1,214,636
Messages
6,120,666
Members
448,977
Latest member
moonlight6

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top