Hi Jon
Can this code be modified to copy the contents of each sheet? (assume each sheet has contents fitting exactly one page). Thanks
Originally Posted by JonPeltier
Hi Jon
Can this code be modified to copy the contents of each sheet? (assume each sheet has contents fitting exactly one page). Thanks
Originally Posted by JonPeltier
That's pretty much what it does. What you could do is modify the range selection bit to use the print area of each sheet:
[VBA]For Each objSheet In ActiveWorkbook.Worksheets
objSheet.Activate
ObjSheet.Range("Print_Area").CopyPicture Appearance:=xlScreen, Format:=xlPicture
'Create new slide for the data
Set pptSld = pptPre.Slides.Add(pptPre.Slides.Count + 1, ppLayoutBlank)
' paste the copied picture
pptSld.Shapes.Paste
Next[/VBA]
or simply copy the used range:
[VBA] ObjSheet.UsedRange.CopyPicture Appearance:=xlScreen, Format:=xlPicture
[/VBA]
- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com
_______
Thanks
How would you modify this code if you were a) doing the same for a word document to powerpoint (1 page per slide) and b) doing the same for an existing powerpoint doc to a new pp doc (slide for slide)?
Kind Regards
Originally Posted by JonPeltier