I have a vba code that copies some data from Excel, and then pastes the data into powerpoint to create a bar chart. It does this this by pasting the data into the bar chart excel sheet. The issue I'm running into is that I the data that gets pasted to the powerpoint chart will differ in size, so I want to make sure that the powerpoint chart will include the entire contents.
Here's a sample of the code that copies data from excel to powerpoint:
The copy and pasting works fine. I just dont know how to change the data selection range
Here's a sample of the code that copies data from excel to powerpoint:
Code:
Thisworkbook.sheets("ws").Range("AF6:AJ6").select
Range(Selection, Selection.End(xlDown).Select
selection.Copy
With ppslide.Shapes("Chart").Chart.ChartData
.Activate
.workbook.Sheet(1).Range("A2").PasteSpecial Paste:=xlPasteValues
.workbook.close
The copy and pasting works fine. I just dont know how to change the data selection range