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.

Flexible Slide Numbering

This handy VBA routine from John Wilson of PowerPoint Alchemy will number your slides consecutively, starting at any slide in the presentation. It gives you the option of skipping Title slides in the numbering sequence.

When asked for a starting number, enter 999 to delete all slide numbers.

Adjust the variable sngLeftPos to change the position of the number on the slide.

Sub Numberme()
'Copyright PowerPoint alchemy
'Numbers consecutively from a start slide but does not number title slides if requested
'enter 999 to remove numbers
On Error GoTo ErrHandler

    Dim lFrom As Long, lTot As Long, lNum As Long, n As Long
    Dim sngLeftpos As Single, strTask As String
    Dim oSld As Slide, oShp As Shape

    lFrom = CInt(InputBox("start numbering from slide ...?"))

    If lFrom <> 999 Then strTask = MsgBox("Number Title layout slides?", vbYesNo)
    lNum = 1

    lTot = ActivePresentation.Slides.Count

    'strip old numbers
    For Each oSld In ActivePresentation.Slides
        For Each oShp In oSld.Shapes
            If oShp.Name = "snumber" Then oShp.Delete
        Next oShp
    Next oSld

    'main routine
    sngLeftpos = 550
    If lFrom = 999 Then Exit Sub

    If lFrom > lTot Then
        MsgBox "You have chosen a start point > than the number of slides!", vbCritical, "Error"
        Exit Sub
    End If

    For n = lFrom To lTot
        With ActivePresentation.Slides(n).Shapes.AddTextbox(msoTextOrientationHorizontal, _
            Left:=sngLeftpos, _
            Top:=500, _
            width:=200, _
            height:=50)

            If strTask = vbNo And ActivePresentation.Slides(n).Layout = ppLayoutTitle Then
                ' don't number the slide but increment the slide number
                ' comment the following line out if you want title slides to be skipped
                ' ie, not to be included in numbering sequence and not numbered 
                lNum = lNum + 1
            Else
                .TextFrame.TextRange.Text = CStr(lNum)
                .Name = "snumber"
                lNum = lNum + 1
            End If
        End With
     Next

    Exit Sub

ErrHandler:
    MsgBox "Sorry there's an error!", vbCritical

End Sub


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

Flexible Slide Numbering
http://www.pptfaq.com/FAQ00853_Flexible_Slide_Numbering.htm
Last update 07 June, 2011
Created: