Selecting buttons using VBA
Can anybody help with a small problem I have, I am trying to loop through files in a directory and add amendments. Part of this involves changing the properties of a button on a particular sheet.
The problem is, for some reason these buttons have different names ie “Button18”, “Button 51” etc.
There is only one button on this particular sheet, and I would like to be able to select it regardless of its name.
Here is what I have, but cannot get it to work
Can anybody help with a small problem I have, I am trying to loop through files in a directory and add amendments. Part of this involves changing the properties of a button on a particular sheet.
The problem is, for some reason these buttons have different names ie “Button18”, “Button 51” etc.
There is only one button on this particular sheet, and I would like to be able to select it regardless of its name.
Here is what I have, but cannot get it to work
Code:
For Each Shape In ActiveSheet.Shapes
Shape.Select
With Selection
.Placement = xlFreeFloating
.PrintObject = False
End With
Next