Tired of wasting time on your PowerPoint? You probably need a macro!
- In PowerPoint, go to File → Options.
- Click Customize Ribbon.
- On the right, check Developer, then click OK.
- Press
Alt + F11or click Developer → Visual Basic.
- In the VBA editor, go to Insert → Module.
- Paste this code:
- In the VBA window, click anywhere inside the macro code.
- Press
F5or go to Run → Run Sub/UserForm.
| Change | Variable | Example |
|---|---|---|
| Font size | fontSizeText |
16 |
| Font name | fontName |
"Calibri" |
| Text vertical position | bannerTop |
5 |
| Space between text & bar | barYOffset |
5 |
| Bar thickness | barHeight |
2 |
| Text active color | textColorActive |
RGB(0,0,0) |
| Text inactive color | textColorInactive |
DarkerRGB(255,255,255,0.15) |
| Bar active color | barColorActive |
same as active text |
| Bar inactive color | barColorInactive |
same as inactive text |
| Color inversion | invertedSlides |
T or F and specify slide numbers |
| Line vs. rectangle bar | Use AddLine instead of AddShape |
| Feature | Description |
|---|---|
startSlide, endSlide |
Define the slide range where slide numbers appear. |
invertColorSlides = Array(...) |
Set which slide numbers should use white text. |
| Text formatting | Font name, size, and alignment are applied consistently. |
| Positioning | Bottom-right placement with margins. |
| Text fit | Automatically sizes the box so numbers stay on one line. |
| Locked | Shape is locked to avoid accidental edits. |
I tried to make the macro more modular and easier to edit by centralizing user-defined!