bujay
06-16-2023, 03:26 PM
The VBA below does exactly what I want it to do but as you can see, it only works on Slide 14 in its current form....
Is there a way I could create a loop so that I can list the slides I want this to apply to?
For example, how would I adjust the macro below to apply to slides 13, 14, 15, 16, 18, 19, 20, 25, 27, etc....perhaps I could write an array for the slide numbers...
Function getshape1() As Shape
Set getshape1 = ActivePresentation.Slides(14).Shapes(5)
End Function
Function getshape2() As Shape
Set getshape2 = ActivePresentation.Slides(14).Shapes(6)
End Function
Function getshape3() As Shape
Set getshape3 = ActivePresentation.Slides(14).Shapes(7)
End Function
Function getshape4() As Shape
Set getshape4 = ActivePresentation.Slides(14).Shapes(8)
End Function
Sub move_shapes()
Set sh1 = getshape1
Set sh2 = getshape2
Set sh3 = getshape3
Set sh4 = getshape4
sh1.Top = 80
sh1.Left = 35
sh2.Top = 80
sh2.Left = 488
sh3.Top = 297
sh3.Left = 35
sh4.Top = 297
sh4.Left = 488
End Sub
Thanks!
Is there a way I could create a loop so that I can list the slides I want this to apply to?
For example, how would I adjust the macro below to apply to slides 13, 14, 15, 16, 18, 19, 20, 25, 27, etc....perhaps I could write an array for the slide numbers...
Function getshape1() As Shape
Set getshape1 = ActivePresentation.Slides(14).Shapes(5)
End Function
Function getshape2() As Shape
Set getshape2 = ActivePresentation.Slides(14).Shapes(6)
End Function
Function getshape3() As Shape
Set getshape3 = ActivePresentation.Slides(14).Shapes(7)
End Function
Function getshape4() As Shape
Set getshape4 = ActivePresentation.Slides(14).Shapes(8)
End Function
Sub move_shapes()
Set sh1 = getshape1
Set sh2 = getshape2
Set sh3 = getshape3
Set sh4 = getshape4
sh1.Top = 80
sh1.Left = 35
sh2.Top = 80
sh2.Left = 488
sh3.Top = 297
sh3.Left = 35
sh4.Top = 297
sh4.Left = 488
End Sub
Thanks!