Hi,
Not sure what you're asking for here. Which charts on which sheet do you want to copy?
And where should they be copied to? - to PowerPoint?, or to another sheet in Excel (if so which sheet in which workbook?)?
To just copy all the charts from one worksheet to PowerPoint, you could use:
Sub PushChartsToPPT()
'Set reference to 'Microsoft PowerPoint 1x.0 Object Library'
'in the VBE via Tools > References...
'
'No need for the reference if we use Late Binding:
Dim ppt As Object
'PowerPoint.Application
Dim pptPres As Object
'PowerPoint.Presentation
Dim pptSld As Object
'PowerPoint.Slide
Dim pptCL As Object
'PowerPoint.CustomLayout
Dim pptShp As Object
'PowerPoint.Shape
Dim cht As Chart
Dim ws As Worksheet
Dim i As Long
'Get the PowerPoint Application object:
Set ppt = CreateObject("PowerPoint.Application")
ppt.Visible = msoTrue
Set pptPres = ppt.Presentations.Add
DoEvents
'give the new presentation a chance to open...
DoEvents
'found this was necessary if there was already
DoEvents
'a PowerPoint presentation open!
'Get a Custom Layout:
For Each pptCL In pptPres.SlideMaster.CustomLayouts
If pptCL.Name = "Title and Content" Then Exit For
Next pptCL
'Copy ALL charts embedded in ONE WorkSheet:
With ActiveWorkbook.Worksheets("SheetName")
For i = 1 To
.ChartObjects.Count
Set pptSld = pptPres.Slides.AddSlide(pptPres.Slides.Count + 1, pptCL)
pptSld.Select
For Each pptShp In pptSld.Shapes.Placeholders
If pptShp.PlaceholderFormat.Type = 7 Then Exit For
'7 = ppPlaceholderObject
Next pptShp
Set cht =
.ChartObjects(i).Chart
cht.ChartArea.Copy
ppt.Activate
pptShp.Select
ppt.Windows(1).View.PasteSpecial ppPasteEnhancedMetafile
Next i
End With
End Sub
Cheers
Rich