I have the following code that is intended to generate non-repeating random numbers as many as my slides and then go to the random slide after a click. I'd like to add a button to the last slide to end the slide show if possible. This has to be floating because if it is displayed at random, who knows which the last slide is. Anyway, that's secondary but my code seems to work during debug but when I run it, the action button does nothing beginning from the first page. I will appreciate any help. Thanks
Dim dupSlide As Boolean
Public curSlide(10) As Integer
Public numOfSlides As Integer
Public k As Integer
Sub flipSlids()
With ActivePresentation.Slides
' If SSW.Presentation.SlideShowSettings.StartingSlide Then
numOfSlides = .Count
End With
Randomize
For i = 1 To numOfSlides - 1
100 dupSlide = False
curSlide(i) = Int(numOfSlides * Rnd) + 1
If i > 1 Then
For j = 1 To i - 1
If curSlide(i) = curSlide(j) Then
dupSlide = True
End If
Next
End If
If dupSlide = True Then
GoTo 100
' ActivePresentation.SlideShowWindow.View.GotoSlide (curSlide(i))
End If
Next
k = 1
' ActivePresentation.SlideShowWindow.View.GotoSlide (curSlide(k))
Call shwSlides
End Sub
Sub shwSlides()
If curSlide(k) <> 1 Then
ActivePresentation.SlideShowWindow.View.GotoSlide (curSlide(k))
End If
k = k + 1
End Sub