قالب وردپرس درنا توس
Home / Tips and Tricks / How to Create a Progress Bar in Microsoft PowerPoint

How to Create a Progress Bar in Microsoft PowerPoint



Microsoft PowerPoint logo

A progress bar is an image that visually shows in PowerPoint the percentage of the slide show that has been completed. It is also a good indication of the amount remaining. Here’s how to create a progress bar in Microsoft PowerPoint.

You can manually create a progress bar by inserting a shape at the bottom of each slide. The problem with this approach is that you need to measure the length of each shape based on the number of slides in the presentation. Also, if you add or remove a slide, you must manually run the progress bar on each slide in the slide show.

To keep everything consistent and save yourself a serious headache, you can use a macro to create a progress bar. With this macro, the progress bar automatically adjusts itself based on the number of slides in the presentation.

RELATED: Macros Explained: Why Microsoft Office Files Can Be Dangerous

First, open the PowerPoint presentation for which you want to create a progress bar. Once it̵

7;s open, click on the ‘View’ tab and select ‘Macros’.

The “Macro” window will appear. In the text box under “Macro Name”, type a name for your new macro. The name cannot contain spaces. Once entered, click “Create” or, if you are using a Mac, click the “+” icon.

The “Microsoft Visual Basic for Applications (VBA)” window will now open. In the editor you see this code:

Sub ProgressBar()

End Sub

First, place your cursor between the two lines of code.

Then copy and paste this code:

On Error Resume Next
With ActivePresentation
For X = 1 To .Slides.Count
.Slides(X).Shapes("PB").Delete
Set s = .Slides(X).Shapes.AddShape(msoShapeRectangle, _
0, .PageSetup.SlideHeight - 12, _
X * .PageSetup.SlideWidth / .Slides.Count, 12)
s.Fill.ForeColor.RGB = RGB(127, 0, 0)
s.Name = "PB"
Next X:
End With

Once pasted, your code should look like this in the editor.

Note: There are now no line breaks between the first and last lines of code.

You can now close the VBA window. Back in Microsoft PowerPoint, click “Macros” again in the “View” tab.

Then choose your macro name (“ProgressBar” in our example) to select it and then click “Run”.

The progress bar will now appear at the bottom of each slide of your presentation.

When you delete a slide, the progress bar adjusts itself automatically. If you add a new slide, you must run the macro again (View> Macro> Run). It’s a minor inconvenience compared to adjusting everything manually.




Source link