Help with unrandoming some slides.

J

John

Hello.

Found this great code to randomize a slide show, but it works too good.

Is there any way to modify it so that it does NOT randomize the first two
slides?


(Slide 1 has a title screen and Slide 2 has the rules screen, but when I
run the macro, they get randomized and wind up floating around the
presentation :)

I changed the "i= 1..." to "i=2" but that didn't help.
I was just going to add a button that appears on slide 2 that runs the
macro.

Thanks for any help and suggestions!

John
______________

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
 
G

Guest

The following code would work:

---
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)
If Not ((myvalue = 1) Or (myvalue = 2)) Then
ActiveWindow.ViewType = ppViewSlideSorter
ActivePresentation.Slides(myvalue).Select
ActiveWindow.Selection.Cut
ActivePresentation.Slides(islides - 1).Select
ActiveWindow.View.Paste
End If
Next
End Sub
---

It won't affect slides 1 and 2 while randomizing the slides.

- Chirag

PowerShow - View multiple shows simultaneously
http://officeone.mvps.org/powershow/powershow.html
 
J

John

Thanks for replying.


I just realized that both codes are only working in slidesorter view.

I need to be able to run the randsort macro from WITHIN the slideshow.

What I would like is for any user to open the presentation in normal view,
look at the title screen on slide 1, then click to bring up slide 2 which
has the rules of the game. Then a button on slide 2 would pop up and run the
macro to randomize all the rest of the slides and then go to slide 3.

On Slides 3 to the end are questions and answers, so I am trying to get it
so that everytime they view this ppt, the same questions are available to be
shown, but not the same order so that question 1 is not always slide 3,
question 2 on slide 4, etc.

Thanks for helping!

John
 
C

Chirag

Hi John,

See if the following code helps:

---
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)
If Not ((myvalue = 1) Or (myvalue = 2)) Then
ActivePresentation.Slides(myvalue).Cut
ActivePresentation.Slides.Paste
End If
Next
End Sub
---

- Chirag

PowerShow - View multiple shows simultaneously
http://officeone.mvps.org/powershow/powershow.html
 
D

David M. Marcovitz

Your best bet might be to keep the slides in order but randomly select
which one to go to next. Check out examples 8.16 and 8.17 on my site.
In 8.16, 5 questions are randomly selected from all the slides except the
first and last. After 5 questions, it jumps to the last slide. 8.17 is
the same except that it asks how many questions you want to answer first.
This is all done in slide show mode. Go to my web site:

http://www.loyola.edu/education/PowerfulPowerPoint/

and click on Examples by Chapter and Chapter 8 to get to the examples.

--David

--
David M. Marcovitz
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.loyola.edu/education/PowerfulPowerPoint/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top