Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Sub to reverse slides order

5,222 views
Skip to first unread message

Max

unread,
Mar 11, 2008, 1:25:17 AM3/11/08
to
I have 50 slides in a deck, and would like to flip/reverse the order so that
slide 50 becomes slide 1, slide 49 becomes slide 2, and so on.

Is there a sub which could do this? Thanks


John Wilson

unread,
Mar 11, 2008, 3:34:01 AM3/11/08
to
Use the moveto feature

There's an example in our vba section
http://www.pptalchemy.co.uk/powerpoint_hints_and_tips_tutorials.html#vba

Regards John

--
Amazing PPT Hints, Tips and Tutorials

http://www.PPTAlchemy.co.uk
http://www.technologytrish.co.uk
email john AT technologytrish.co.uk

Max

unread,
Mar 11, 2008, 4:41:10 AM3/11/08
to
Thanks, tried running your sub below,
but got stuck at this line:
(Run-time error '91')

If opres.ReadOnly = True Then

How can I proceed?

-------
Sub reversi()
Dim opres As Presentation
Dim i As Integer
'Cannot alter read only presentation
If opres.ReadOnly = True Then Exit Sub
Set opres = ActivePresentation
'seqentially move slides to front
For i = 2 To opres.Slides.Count
opres.Slides(i).MoveTo 1
Next i
End Sub


John Wilson

unread,
Mar 11, 2008, 5:09:01 AM3/11/08
to
Hi

Yep there's a typo

Either change the line to
If ActivePresentation.ReadOnly .....

or move this line below the line which sets opres=ActivePresentation


--
Amazing PPT Hints, Tips and Tutorials

Max

unread,
Mar 11, 2008, 5:29:57 AM3/11/08
to
Thanks, that did it !

I would also appreciate your help in adapting your sub to do the
interleaving bit in my other posting. I'm afraid I'm not up to the task.


John Wilson

unread,
Mar 11, 2008, 6:58:04 AM3/11/08
to
Something like this I guess (not tested)

Sub inter()
Dim i As Integer
Dim pos As Integer
Dim opres As Presentation
Set opres = ActivePresentation
For i = (opres.Slides.Count) / 2 + 1 To opres.Slides.Count - 1
pos = pos + 2
opres.Slides(i).MoveTo (pos)
Next
End Sub


--
Amazing PPT Hints, Tips and Tutorials

Max

unread,
Mar 11, 2008, 10:00:13 AM3/11/08
to
Thanks, it does the job very well !


Chris Boddington

unread,
Jun 11, 2021, 4:12:48 PM6/11/21
to
On Tuesday, March 11, 2008 at 3:00:13 PM UTC+1, Max wrote:
> Thanks, it does the job very well !
Certainly does, thanks
0 new messages