Skip to content

Instantly share code, notes, and snippets.

@nebgnahz
Last active August 29, 2015 14:19
Show Gist options
  • Save nebgnahz/61882ae9bfcb182dd2c8 to your computer and use it in GitHub Desktop.
Save nebgnahz/61882ae9bfcb182dd2c8 to your computer and use it in GitHub Desktop.
Add ProgressBar to Your Powerpoint Slides
After finish the slides,
1. Go to "Tools > Macro > Visual Basic Editor".
2. Then "Insert > Module" and copy code (2.ProgressBar) into the page.
3. Configure by changing the `Height`, `Color`, `Position` and `StartFrom` to your preference.
4. Then "Run > Run Sub/UserForm" will do the trick.
Sub ProgressBar()
' Define your preference here
Height = 10
' Choose the color you like. Default is gray.
Color = RGB(88, 88, 88)
' Position can be "top" or "bottom"
Position = "bottom"
' From which page the ProgressBar starts. Sometimes you don't want it on th first page.
StartFrom = 1
On Error Resume Next
With ActivePresentation
For X = 1 To .Slides.Count
.Slides(X).Shapes("PB").Delete
Next X:
For X = StartFrom To .Slides.Count
If Position = "bottom" Then
RecTopline = .PageSetup.SlideHeight - Height
ElseIf Position = "top" Then
RecTopline = 0
End If
Set s = .Slides(X).Shapes.AddShape(msoShapeRectangle, _
0, RecTopline, X * .PageSetup.SlideWidth / .Slides.Count, Height)
Call s.Fill.Solid
s.Fill.ForeColor.RGB = Color
s.Line.Visible = False
s.Name = "PB"
Next X:
End With
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment