Hi,
How do I define a chart's source data in VBA? Is it possible? I can't seem to find the command to do so
Thanks
Hi,
How do I define a chart's source data in VBA? Is it possible? I can't seem to find the command to do so
Thanks
Last edited by Coaster; 05-08-2010 at 04:58 PM.
Coaster,
start the macro recorder, select some data, create a chart. Select a chart series, change the data source. Stop the macro recorder. Study the code.
This is for Excel 2003. If you use 2007 that won't work.
Please update your profile and indicate your Excel version to take the guesswork out of the answering.
I'm sorry I didn't remember that "little" detail lol
Excel 2007...I tried doing that but didn't get anywhere, as you said...what should I do?
Coaster, unfortunately the Excel 2007 macro recorder ignores a lot of things to do with charting. It gets better again with Excel 2010.
I recorded the code below with 2010
- selected a range, first column has dates, third and second column has numbers
- created a chart (clustered column chart)
- edited each series and...- defined new data ranges and data series title for two seriesHope you can glean something from that.
- defined new range for X axis (categories)
cheersPlease Login or Register to view this content.
Thank you very much, that's just what i needed!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks