Pinlop
Pinlop

Reputation: 245

Populate data in an unlinked PowerPoint Chart

I'm looking to populate charts in a presentation. I normally create "Shell decks" for my presentations where I strip out the data from a previous presentation (by hand) and then I go into an excel file look up what values I need to paste in and then paste it populate the graph. I do this for every graph manually. This all seems very easily done in VBA, I have every part of the code up until editing the data in the chart. I can't figure it out.

This is my best attempt at setting the first bar in a chart = 7.5, and it's laughable:

Shapes.Chart.SeriesCollection(1).Values(1) = 7.5

Could I please get some help figuring out what I would need to do for this?

P.S. I can't create a chart in excel and then paste into PowerPoint, I must edit the one already there.

Thanks!

Upvotes: 0

Views: 165

Answers (1)

jsotola
jsotola

Reputation: 2278

this is the worksheet object that feeds data to a chart in powerpoint

 Application.ActivePresentation.Slides(1).Shapes(1).Chart.ChartData.Workbook.activesheet

so you should be able to copy a range from excel into powerpoint

Upvotes: 1

Related Questions