Consulting

Results 1 to 20 of 71

Thread: Copy each excel worksheets and paste in each indivual slides

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    MS Excel MVP VBAX Tutor
    Joined
    Mar 2005
    Posts
    246
    Location
    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
    _______

  2. #2
    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

    Quote 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]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •