R
robdonn
Is there any way to loop through shape names using variables?
The following code I want to use doesn't work
For X = 1 to 6
For Y = 100 to 500 step 100
shape_name = Str(X) & "-" & Str(Y)
ActivePresentation.Slides(4).Shapes(shape_name).Visible = False
Next Y
Next X
The code it replaces is repetitive but does work
ActivePresentation.Slides(4).Shapes("1-100").Visible = False
ActivePresentation.Slides(4).Shapes("1-200").Visible = False
ActivePresentation.Slides(4).Shapes("1-300").Visible = False
etc, etc to
ActivePresentation.Slides(4).Shapes("6-400").Visible = False
ActivePresentation.Slides(4).Shapes("6-500").Visible = False
Can anyone help me?
The following code I want to use doesn't work
For X = 1 to 6
For Y = 100 to 500 step 100
shape_name = Str(X) & "-" & Str(Y)
ActivePresentation.Slides(4).Shapes(shape_name).Visible = False
Next Y
Next X
The code it replaces is repetitive but does work
ActivePresentation.Slides(4).Shapes("1-100").Visible = False
ActivePresentation.Slides(4).Shapes("1-200").Visible = False
ActivePresentation.Slides(4).Shapes("1-300").Visible = False
etc, etc to
ActivePresentation.Slides(4).Shapes("6-400").Visible = False
ActivePresentation.Slides(4).Shapes("6-500").Visible = False
Can anyone help me?