BobBridges
Active Member
I don't handle Shapes much, but I'm doing some automation for a user who's created a bunch of button to navigate from one worksheet to another, and he'd like me to copy a button to a new worksheet when I create it. I can find an example of the button on another worksheet easily enough, and I see various methods for copying it. The Copy method puts a copy of the shape on the clipboard; Pickup and Apply force an existing shape to take on the characteristics of another shape; and Duplicate returns a copy of a shape.
But when it comes to putting the new shape in the new worksheet, I don't see how. All the Add methods I see in the Shapes collection (and there are quite a few) require a handful of extra arguments that specify things about the new shape that I intend to copy from the old shape, including its position on the sheet. The AddShape method, for example, requires arguments for Type, Left, Right, Width and Height. Must I specify some fake values for them and then write over the shape with a Set statement or Apply method? Seems like wasted effort. Does anyone know the better way?
I also posted this question on the MSOffice forum, but past experience leads me to expect little help there; there are folks there who are very good indeed (better than me, anyway) with Excel functions and formulae, but when it comes to VBA there seems to be less help.
But when it comes to putting the new shape in the new worksheet, I don't see how. All the Add methods I see in the Shapes collection (and there are quite a few) require a handful of extra arguments that specify things about the new shape that I intend to copy from the old shape, including its position on the sheet. The AddShape method, for example, requires arguments for Type, Left, Right, Width and Height. Must I specify some fake values for them and then write over the shape with a Set statement or Apply method? Seems like wasted effort. Does anyone know the better way?
I also posted this question on the MSOffice forum, but past experience leads me to expect little help there; there are folks there who are very good indeed (better than me, anyway) with Excel functions and formulae, but when it comes to VBA there seems to be less help.