In presentation mode, I want only unhidden slides to appear with consecutive page numbers. How can I avoid that hidden slides are counted?
Remove slide numbers from your presentationOn the Insert tab, select Slide Number. On the Slide tab, clear the box named Slide number.
The hidden slide will have parentheses around the slide number. When you show a Hidden Slide and then click or press the spacebar to advance to the next slide in the sequence, it will jump to your next “real” slide, not the next Hidden Slide (even if one happened to be next).
On the Design tab, in the Customize group, click Slide Size, and then click Custom Slide Size. In the Slide Size dialog box, in the Number slides from box, enter the number that you want to show on the first slide in your presentation, and then click OK.
Thank you Steve. I found an answer to my question elsewhere. The function below allows you to avoid that hidden slides are interfering with the slide numbers of unhidden slides in presentation mode.
Sub Number_NonHidden()
'For v.2007 onwards only
Dim osld As Slide
Dim objSN As Shape
Dim lngNum As Long
'check all slides
For Each osld In ActivePresentation.Slides
'Is it hidden
If osld.SlideShowTransition.Hidden Then
osld.HeadersFooters.SlideNumber.Visible = False
Else
osld.HeadersFooters.SlideNumber.Visible = True
Set objSN = getNumber(osld)
lngNum = lngNum + 1
If Not objSN Is Nothing Then ' there is a number placeholder
objSN.TextFrame.TextRange = CStr(lngNum + 1)
End If
End If
Next osld
End Sub
Function getNumber(thisSlide As Slide) As Shape
For Each getNumber In thisSlide.Shapes
If getNumber.Type = msoPlaceholder Then
If getNumber.PlaceholderFormat.Type = ppPlaceholderSlideNumber Then
'it's the slide number
Exit Function
End If
End If
Next getNumber
End Function
In order to avoid that the title slide is numbered insert lngNum = -1 as follows and delete the slide number box in the master title slide.
'check all slides
lngNum = -1
For Each osld In ActivePresentation.Slides
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With