Solved

Convert data to individual slides

Posted on 2013-05-23
3
289 Views
Last Modified: 2013-08-22
Hello, I have 3 columns and 300 rows in excel, and I need each row to be its own slide, so i would have 300 slides.

It would looke like the

Column 1
Column 2
Column 3

I know there is an easy solution, I don't even think I need VBA, I am actually hoping to avoid it all together, I am thinking somehting more like a mail merge, but I cannot find that function in PPT.
0
Comment
Question by:Frankkadaf
3 Comments
 
LVL 39

Expert Comment

by:nutsch
ID: 39192604
I don't think there's an easy solution, and VBA might have to do it. Try something like this, after adding a reference to the microsoft powerpoint object library.


Option Explicit


Sub sendDataToPowerpoint()
Dim lLoop As Long, shtOrg As Worksheet, shtTemp As Worksheet
Dim oPPTApp As PowerPoint.Application, oPPTPres As PowerPoint.Presentation

Set oPPTApp = CreateObject("PowerPoint.Application")
Set oPPTPres = oPPTApp.Presentations.Add(msoTrue)

'turn off updates to speed up code execution
With Application
    .ScreenUpdating = False
    .EnableEvents = False
    .Calculation = xlCalculationManual
    .DisplayAlerts = False
End With

Set shtOrg = ActiveSheet
Set shtTemp = Sheets.Add

For lLoop = 1 To 300
    shtOrg.Cells(lLoop, 1).Resize(1, 3).Copy
    shtTemp.Cells(1, 1).PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=True
    shtTemp.Columns(1).AutoFit
    sendToPowerpoint shtTemp.Range("A1:A3"), oPPTApp, oPPTPres

Next lLoop

shtTemp.Delete

With Application
    .ScreenUpdating = True
    .EnableEvents = True
    .Calculation = xlCalculationAutomatic
    .DisplayAlerts = True
End With

End Sub



Sub sendToPowerpoint(rgCopy As Range, oPPTApp As PowerPoint.Application, oPPTPres As PowerPoint.Presentation)

Dim oPPTSlide As PowerPoint.Slide
Dim oPPTShape As Object, CommentIndicator As Long, blDisplayGridlines As Boolean, blArr(1 To 10) As Boolean

rgCopy.Copy

oPPTApp.Visible = msoTrue
Set oPPTSlide = oPPTPres.Slides.Add(Index:=oPPTPres.Slides.Count + 1, Layout:=ppLayoutBlank)

oPPTApp.Activate

Set oPPTShape = oPPTSlide.Shapes.PasteSpecial(ppPasteEnhancedMetafile) 'change to suit needs

With oPPTShape
    If .Width > oPPTPres.SlideMaster.Width - 20 Then .Width = oPPTPres.SlideMaster.Width - 20
    If .Height > oPPTPres.SlideMaster.Height - 20 Then .Height = oPPTPres.SlideMaster.Height - 20
    .Left = (oPPTPres.SlideMaster.Width - .Width) / 2
    .Top = (oPPTPres.SlideMaster.Height - .Height) / 2
End With

Set oPPTSlide = Nothing

Application.CutCopyMode = False

End Sub

Open in new window

0
 
LVL 24

Expert Comment

by:Echo_S
ID: 39192805
There's not an easy way to do this in PPT, but there is an add-in already on the market for it: PPTMerge. Get it here: http://www.pptools.com/merge/index.html
0
 
LVL 16

Accepted Solution

by:
Jerry Paladino earned 500 total points
ID: 39194048
1)  Use WORD and EXCEL to create a MailMerge document to create the 300 pages.
2)  Open the Doc (Docx) file in Powerpoint as an Outline.

In the WORD mailmerge document, use the HEADING1 style for the Title of the slide and use the HEADING2 style for the body text of the slide.

http://office.microsoft.com/en-us/word-help/create-a-powerpoint-presentation-from-a-word-outline-HP005190174.aspx

This may give as bit more control over the slide layout and format.
0

Featured Post

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

822 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question