Progress Bar Macro - Help Need from Experts
ello Macro Masters!
I have a Macro Code to insert a Progress Bar (Copy Paste & Resize an image) in PowerPoint presentation skipping pre-programmed slides (First 2 and Last 2). I need help with two things:
1. Automatically Skip Hidden Slides (Do not include Progress bar) and keep Bar Size based on Applicable Slides
2. Input Box to type Slides to Ignore (Do not apply progress Bar - Skip Slides) when macro its executed.
PowerPoint Macro File: https://drive.google.com/file/d/1bon...ew?usp=sharing
Here is the Macro Code Allocated in Module 1
Code:
Sub ProgressBar()
Dim Width As Integer
Dim MinSize As Integer
ActivePresentation.Slides(1).Shapes("_ProgressBar").Visible = msoFalse
ActivePresentation.Slides(1).Shapes("_ProgressBar").Copy
On Error Resume Next
For Each Sld In ActivePresentation.Slides
For i = Sld.Shapes.Count To 1 Step -1
If Sld.Shapes(i).Name = ("_ProgressBar") Then Sld.Shapes(i).Delete
Next i
Next Sld
scount = ActivePresentation.Slides.Count
On Error Resume Next
If ActivePresentation.Slides(2).Shapes(2).Name = "_PresentationIndex" Then
For j = 3 To scount - 2
ActivePresentation.Slides(j).Shapes.Paste
ActivePresentation.Slides(j).Shapes("_ProgressBar").Visible = msoTrue
Next j
Width = Application.ActivePresentation.PageSetup.SlideWidth
MinSize = Width / scount 'Determine the min size of Progress Bar
For j = 3 To scount - 3
ActivePresentation.Slides(j).Shapes("_ProgressBar").Width = MinSize * j 'Bar Re-Size based on quantity of slides.
Next j
Else
For j = 2 To scount - 2
ActivePresentation.Slides(j).Shapes.Paste
ActivePresentation.Slides(j).Shapes("_ProgressBar").Visible = msoTrue
Next j
Width = Application.ActivePresentation.PageSetup.SlideWidth
MinSize = Width / scount 'Determine the min size of Progress Bar
For j = 2 To scount - 2
ActivePresentation.Slides(j).Shapes("_ProgressBar").Width = MinSize * j 'Bar Re-Size based on quantity of slides.
Next j
'Delete bar from "Thanks!" Page
If ActivePresentation.Slides(j).Shapes("_Thanks") = True Then
ActivePresentation.Slides(j).Shapes("_ProgressBar").Delete
End If
End If
ActivePresentation.Slides(1).Shapes.Paste
ActivePresentation.Slides(1).Shapes("_ProgressBar").Visible = msoFalse
End Sub