PDA

View Full Version : PPT VBA to Center and Middle Align Object on certain slides



gmooney100
08-24-2021, 10:31 AM
I have a PPT that has an object on certain slides called "Group3" that I would like to center and middle align for just those certain slides.

The slides are 17-22, 24-27 and 29 to 32

Can someone help me create a Sub Procedure for this?

John Wilson
08-24-2021, 10:54 AM
Try

Sub center_align()
Dim osld As Slide
For Each osld In ActivePresentation.Slides.Range(Array(17, 18, 19, 20, 21, 22, 24, 25, 26, 27, 29, 30, 31, 32))
With osld.Shapes.Range("Group 3")
.Align (msoAlignMiddles), True
.Align (msoAlignCenters), True
End With
Next osld
End Sub