Results 1 to 14 of 14

MAcro to paste excel table into PPT slide automatically

Threaded View

sameeru MAcro to paste excel table... 12-10-2013, 02:16 AM
mikeTRON Re: MAcro to paste excel... 12-10-2013, 03:01 AM
sameeru Re: MAcro to paste excel... 12-10-2013, 03:08 AM
geliedee Re: MAcro to paste excel... 12-10-2013, 04:01 AM
geliedee Re: MAcro to paste excel... 12-10-2013, 04:04 AM
sameeru Re: MAcro to paste excel... 12-10-2013, 04:38 AM
geliedee Re: MAcro to paste excel... 12-10-2013, 05:45 AM
mikeTRON Re: MAcro to paste excel... 12-10-2013, 04:17 AM
geliedee Re: MAcro to paste excel... 12-10-2013, 05:46 AM
sameeru Re: MAcro to paste excel... 12-10-2013, 07:22 AM
mikeTRON Re: MAcro to paste excel... 12-10-2013, 06:07 PM
geliedee Re: MAcro to paste excel... 12-11-2013, 02:25 AM
mikeTRON Re: MAcro to paste excel... 12-12-2013, 12:06 AM
geliedee Re: MAcro to paste excel... 12-12-2013, 05:51 AM
  1. #12
    Forum Contributor geliedee's Avatar
    Join Date
    10-14-2013
    Location
    Manila, philippines
    MS-Off Ver
    Excel 2007
    Posts
    400

    Re: MAcro to paste excel table into PPT slide automatically

    Hi MikeTron and Sameeru,

    this file is unprotected.

    or you can use this code.

    CreatePPT - Button 1
    CreatePPT2 -Button 2
    CreatePPT3- Button 3

    Sub CreatePPT()
        Dim PPApp As PowerPoint.Application
        Dim PPSlide As PowerPoint.Slide
        Dim SheetName As String
        Dim RangePasteType As String
        Dim shp As Shape
        Dim shps As Shapes
        Dim RangeName1, RangeName2 As String
    
        SheetName = ActiveSheet.Name ' Both the tables are in same worksheet
        RangeName1 = "A2:H50"
        RangeName2 = "A2:H50"
     
        If PPApp Is Nothing Then Set PPApp = New PowerPoint.Application
        If PPApp.Presentations.Count = 0 Then PPApp.Presentations.Add
        PPApp.Visible = True
     
        'Set first slide
        '//Set PPSlide = PPApp.ActivePresentation.Slides.Add(1, ppLayoutBlank)
     
        Worksheets(SheetName).Range("A2:H15").Copy
       
     
        Set PPSlide = PPApp.ActivePresentation.Slides.Add(PPApp.ActivePresentation.Slides.Count + 1, ppLayoutBlank)
        Worksheets(SheetName).Range("A2:H17").Copy
       With PPSlide.Shapes.PasteSpecial(ppPasteMetafilePicture)
           .Align msoAlignCenters, True
           .Align msoAlignMiddles, True
           .Item(1).ScaleHeight 1, msoCTrue, msoScaleFromMiddle
    
       End With
    
        AppActivate ("Microsoft Powerpoint")
        'Clean up
        Set PPSlide = Nothing
        Set PPApp = Nothing
    End Sub
    Sub CreatePPT2()
    
        Dim PPApp As PowerPoint.Application
        Dim PPSlide As PowerPoint.Slide
        Dim SheetName As String
        Dim RangePasteType As String
        Dim shp As Shape
        Dim shps As Shapes
        Dim RangeName1, RangeName2 As String
    
        SheetName = ActiveSheet.Name ' Both the tables are in same worksheet
        RangeName1 = "A2:H50"
        RangeName2 = "A2:H50"
     
        If PPApp Is Nothing Then Set PPApp = New PowerPoint.Application
        If PPApp.Presentations.Count = 0 Then PPApp.Presentations.Add
        PPApp.Visible = True
     
        'Set first slide
        '//Set PPSlide = PPApp.ActivePresentation.Slides.Add(1, ppLayoutBlank)
     
        Worksheets(SheetName).Range("A2:H15").Copy
       
     
        Set PPSlide = PPApp.ActivePresentation.Slides.Add(PPApp.ActivePresentation.Slides.Count + 1, ppLayoutBlank)
        Worksheets(SheetName).Range("A18:H32").Copy
       With PPSlide.Shapes.PasteSpecial(ppPasteMetafilePicture)
           .Align msoAlignCenters, True
           .Align msoAlignMiddles, True
           .Item(1).ScaleHeight 1, msoCTrue, msoScaleFromMiddle
    
       End With
    
        AppActivate ("Microsoft Powerpoint")
        'Clean up
        Set PPSlide = Nothing
        Set PPApp = Nothing
    End Sub
    Sub CreatePPT3()
    
        Dim PPApp As PowerPoint.Application
        Dim PPSlide As PowerPoint.Slide
        Dim SheetName As String
        Dim RangePasteType As String
        Dim shp As Shape
        Dim shps As Shapes
        Dim RangeName1, RangeName2 As String
    
        SheetName = ActiveSheet.Name ' Both the tables are in same worksheet
        RangeName1 = "A2:H50"
        RangeName2 = "A2:H50"
     
        If PPApp Is Nothing Then Set PPApp = New PowerPoint.Application
        If PPApp.Presentations.Count = 0 Then PPApp.Presentations.Add
        PPApp.Visible = True
     
        'Set first slide
        '//Set PPSlide = PPApp.ActivePresentation.Slides.Add(1, ppLayoutBlank)
     
        Worksheets(SheetName).Range("A2:H15").Copy
       
     
        Set PPSlide = PPApp.ActivePresentation.Slides.Add(PPApp.ActivePresentation.Slides.Count + 1, ppLayoutBlank)
        Worksheets(SheetName).Range("A33:H51").Copy
       With PPSlide.Shapes.PasteSpecial(ppPasteMetafilePicture)
           .Align msoAlignCenters, True
           .Align msoAlignMiddles, True
           .Item(1).ScaleHeight 1, msoCTrue, msoScaleFromMiddle
    
       End With
    
        AppActivate ("Microsoft Powerpoint")
        'Clean up
        Set PPSlide = Nothing
        Set PPApp = Nothing
    End Sub
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Copy and paste some charts from excel into specific slide on a powerpoint template
    By ones4rus in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-23-2013, 03:00 AM
  2. macro to copy paste excel name range to powerpoint new slide
    By koi in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-17-2013, 04:55 PM
  3. Paste multiple ranges by Inputbox and paste it on one slide in powerpoint
    By irfanparbatani in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-16-2012, 10:32 PM
  4. Replies: 1
    Last Post: 04-02-2012, 03:57 PM
  5. Select active slide by slide number in existing ppt through excel vba
    By amid in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-09-2009, 03:59 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1