Experts Exchange connects you with the people and services you need so you can get back to work.
' PowerPoint VBA Macro to update slide number text in slides where this placeholder is visible.
' Written By : Jamie Garroch of YOUpresent Ltd. http://youpresent.co.uk/
' Date : 21NOV2016
' Notes : this replaces the dynamic ‹#› field in the slide master with fixed text
' so if you delete, add, move slides, you'll need to run this macro again
' to update the text in the slide number placeholder.
Dim oSld As Slide
Dim oShp As Shape
For Each oSld In ActivePresentation.Slides
For Each oShp In oSld.Shapes
If oShp.Type = msoPlaceholder Then
If oShp.PlaceholderFormat.Type = ppPlaceholderSlideNumber Then
oShp.TextFrame.TextRange.Text = "Page " & oSld.SlideIndex & " of " & ActivePresentation.Slides.Count
Open in new window
ActivePresentation.Slides(1).HeadersFooters.SlideNumber.Visible = msoFalse
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.