Supercharge your PowerPoint productivity with
Supercharge your PPT Productivity with PPTools - Click here to learn more.

Proud member of

PPTools

Image Export converts PowerPoint slides to high-quality images.

PPT2HTML exports HTML even from PowerPoint 2010 and 2013, gives you full control of PowerPoint HTML output, helps meet Section 508 accessibility requirements

Merge Excel data into PowerPoint presentations to create certificates, awards presentations, personalized presentations and more

Resize your presentations quickly and without distortion

Language Selector switches the text in your presentation from one language to another

FixLinks prevents broken links when you distribute PowerPoint presentations

Shape Styles brings styles to PowerPoint. Apply complex formatting with a single click.

Flag the existence of hidden slides

Problem

If you have hidden slides in a presentation, normally PowerPoint will jump past them during a show.

However, if you're on the slide immediately before a hidden slide, you can press H to move to the hidden slide following the current slide.

Or rather, you can do that if you happen to remember that the next slide is hidden. Aye, there's the rub. How are you going to remember that?

What if PowerPoint gave you some kind of visual warning that the next slide is hidden?

Solution

With a little VBA, you can have it do exactly that. When you run the following FlagHiddenSlides subroutine on your presentation, it'll put a red star in the lower left corner of each slide that has a hidden slide after it. With a bit of minor editing, you can change the size of the star and the color, or even have it drop in a different shape altogether.

Run DeleteTheFlagShapes to remove all of these newly added shapes at any time.

Sub FlagHiddenSlides()

    Dim oSl As Slide
    For Each oSl In ActivePresentation.Slides
        With oSl
            If .SlideShowTransition.Hidden Then
                ' it's hidden; flag the previous slide
                ' as long as this isn't slide 1
                If .SlideIndex > 1 Then
                    ' and as long as the previous slide itself isn't hidden
                    If Not ActivePresentation.Slides(oSl.SlideIndex - 1).SlideShowTransition.Hidden Then
                        With ActivePresentation.Slides(oSl.SlideIndex - 1)
                            ' Change the 25s in the next line if you want a larger
                            ' or smaller shape
                            With .Shapes.AddShape(msoShape16pointStar, 0, _
                                ActivePresentation.PageSetup.Slideheight - 25, 25, 25)
                                ' Change the color here if you like 
                                .Fill.ForeColor.RGB = RGB(255, 0, 0)
                                ' tag it so we can delete it easily later
                                .Tags.Add "DeleteMe", "YES"
                            End With
                        End With
                    End If
                End If
            End If
        End With
    Next

End Sub

Sub DeleteTheFlagShapes()
    Dim oSl As Slide
    Dim x As Long    
    For Each oSl In ActivePresentation.Slides
        For x = oSl.Shapes.Count To 1 Step -1
            If oSl.Shapes(x).Tags("DeleteMe") = "YES" Then
                oSl.Shapes(x).Delete
            End If
        Next
    Next
End Sub

Or if you'd rather flag the hidden slides themselves (for example, to make the hidden ones more obvious while you're working on your presentation), use this version of FlagHiddenSlides instead (and again use DeleteTheFlagShapes to remove the "flags"):

Sub FlagHiddenSlides()
    Dim oSl As Slide
    For Each oSl In ActivePresentation.Slides
        With oSl
            If .SlideShowTransition.Hidden Then
                With oSl
                    ' Change the 25s in the next line if you want a larger
                    ' or smaller shape
                    With .Shapes.AddShape(msoShape16pointStar, 0, _
                        ActivePresentation.PageSetup.Slideheight - 25, 25, 25)
                        ' Change the color here if you like
                        .Fill.ForeColor.RGB = RGB(255, 0, 0)
                        ' tag it so we can delete it easily later
                        .Tags.Add "DeleteMe", "YES"
                    End With
                End With
            End If
        End With
    Next
End Sub

See How do I use VBA code in PowerPoint? to learn how to use this example code.


Did this solve your problem? If so, please consider supporting the PPT FAQ with a small PayPal donation.
Page copy protected against web site content infringement by Copyscape Contents © 1995 - 2022 Stephen Rindsberg, Rindsberg Photography, Inc. and members of the MS PowerPoint MVP team. You may link to this page but any form of unauthorized reproduction of this page's contents is expressly forbidden.

Supercharge your PPT Productivity with PPTools

content authoring & site maintenance by
Friday, the automatic faq maker (logo)
Friday - The Automatic FAQ Maker

Flag the existence of hidden slides
http://www.pptfaq.com/FAQ00982_Flag_the_existence_of_hidden_slides.htm
Last update 07 June, 2011
Created: