Results 1 to 4 of 4

Thread: Random SlideShow Powerpoint

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    VBAX Regular
    Joined
    Apr 2007
    Posts
    8
    Location
    Hi
    The following doesn't answer all your queries but it does shuffle slides and play them in the shuffled order! The number of 'shuffles' etc can be altered.

    Sub RandomSlides()
    Dim intSlideCount As Integer
    Dim intRandomCut As Integer
    Dim intRandomPaste As Integer
    Dim intLoopCounter As Integer
    'Count number of slides excluding the first two (don't want these shuffled)
    intSlideCount = Application.ActivePresentation.Slides.Count
    intSlideCount = intSlideCount - 2
    ' Initialize random-number generator.
    Randomize
    'Repeat the random change 10 times
    For intLoopCounter = 0 To 10
        ' Generate random value between 3 and last slide.
        intRandomCut = Int((intSlideCount * Rnd) + 3)
        intRandomPaste = Int((intSlideCount * Rnd) + 3)
        'Move a randomly chosen slide from 1 position to another
        ActivePresentation.Slides(intRandomCut).MoveTo toPos:=intRandomPaste
    Next
    'Move to next slide
    SlideShowWindows(Index:=1).View.Next
    End Sub
    You might be able to adapt this to fit your presentation
    Last edited by Aussiebear; 04-28-2023 at 01:15 AM. Reason: Adjusted the code tags

Posting Permissions

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