VBA - Obtaining source-range of a chart

PiVi

New Member
Joined
Jan 11, 2009
Messages
6
Hello there,

I'm new here.

The reason I became member is that I am totaly stuck in my attempt to the following:
I produced a VBA macro in Excel with the intention to examine a test pupils of me have made. One of the items to examine is the chart they have to make.
To control whether or not they picked the right source-range for this chart I have to retrieve the used source-range. Btw it's a pie-chart.
Does anyone know what VBA-code I can use for this problem?

All suggestions are welcome!

PiVi
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Thanks, Mickerickson

Especially the part 'Formula' was the thing i needed.
The part 'Chartobjects(1).Chart' produced error 1004.
I try to translate from the Dutch version: Property ChartObjects of class Chart cannot be collected.

But without that part it works just fine!
Tanks again.

PiVi
 
Upvote 0
That syntax is for a chart on a worksheet. The syntax is different if the chart is its own sheet.
Code:
MsgBox Sheets("Chart1").SeriesCollection(1).Formula
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,728
Members
448,987
Latest member
marion_davis

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