3

I want to make a macro for PowerPoint, to generate a custom show, containing all the slides from my PowerPoint but in random order. How would I do this? I want to be able to run it and create different custom shows each time.

It's been 3 years since I used PowerPoint, and the only experience I have with VB was a little bit of VB6 in 2004.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Frames Catherine White
  • 27,368
  • 21
  • 87
  • 137

1 Answers1

3

Check out the info here.

Sample:

Sub sort_rand()

    Dim i As Integer
    Dim myvalue As Integer
    Dim islides As Integer
    islides = ActivePresentation.Slides.Count
    For i = 1 To ActivePresentation.Slides.Count
        myvalue = Int((i * Rnd) + 1)
        ActiveWindow.ViewType = ppViewSlideSorter
        ActivePresentation.Slides(myvalue).Select
        ActiveWindow.Selection.Cut
        ActivePresentation.Slides(islides - 1).Select
        ActiveWindow.View.Paste
    Next

End Sub
phoebus
  • 14,673
  • 2
  • 33
  • 35