?
Solved

Excel VBA - How to set Source of a Chart object in VBA

Posted on 2008-01-31
2
Medium Priority
?
1,039 Views
Last Modified: 2012-06-27
Experts, In Excel VBA, I need to refer to a chart on another sheet, and set the source of that chart - having it update to reflect the new source.

Any help would be greatly appreciated!
0
Comment
Question by:0tacon
2 Comments
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 500 total points
ID: 20787277
For example:
sheets("sheet name").chartobjects(1).chart.setsourcedata Source:=Sheets(1).Range("a1:a10"), _ PlotBy:=xlColumns

Regards,
Rory
0
 
LVL 12

Author Comment

by:0tacon
ID: 20787416
Works perfectly, many thanks!
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
I tried to use the SharePoint app to Import a Spreadsheet and import an Excel sheet into a Team site made in SharePoint 2016. But that just resulted in getting an error message 'Unknown Error'...
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

600 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question