Autoshape coding

S

Sheldon

I have created an autoshape (rectangle) and have assigned
a macro to it that displays another worksheet.

But, how do I in code, make the shape visible, and not
visible? In code, how do I change its position? In code,
how do enable and disable the macro?


Thanks
 
W

William

Hi Sheldon

To make the shape visible or not visible....
ActiveSheet.Shapes("myshape").Visible = True
or
ActiveSheet.Shapes("myshape").Visible = False

To move the shape.
With ActiveSheet.DrawingObjects("myshape")
..ShapeRange.IncrementLeft -93.75
..ShapeRange.IncrementTop -372.75
End With

What do you mean by disable / enable the macro - if the shape is hidden a
user cannot run the macro by clicking the shape.

--
XL2002
Regards

William

[email protected]

| I have created an autoshape (rectangle) and have assigned
| a macro to it that displays another worksheet.
|
| But, how do I in code, make the shape visible, and not
| visible? In code, how do I change its position? In code,
| how do enable and disable the macro?
|
|
| Thanks
 
W

William

Sorry but I do not understand your post, specifically...
1. "I can't use a macro to move it"
2. "I need to do the move is a procedure independent of clicking on the
shape.

--
XL2002
Regards

William

[email protected]

| I need to clarify.
| I have multiple shapes on the activesheet. Only one of them needs to be
| moved. I can't use a macro to move it. I need to do the move is a
procedure
| independent of clicking on the shape.
|
| Sheldon
|
| "William" wrote:
|
| > Hi Sheldon
| >
| > To make the shape visible or not visible....
| > ActiveSheet.Shapes("myshape").Visible = True
| > or
| > ActiveSheet.Shapes("myshape").Visible = False
| >
| > To move the shape.
| > With ActiveSheet.DrawingObjects("myshape")
| > ..ShapeRange.IncrementLeft -93.75
| > ..ShapeRange.IncrementTop -372.75
| > End With
| >
| > What do you mean by disable / enable the macro - if the shape is hidden
a
| > user cannot run the macro by clicking the shape.
| >
| > --
| > XL2002
| > Regards
| >
| > William
| >
| > [email protected]
| >
| > | > | I have created an autoshape (rectangle) and have assigned
| > | a macro to it that displays another worksheet.
| > |
| > | But, how do I in code, make the shape visible, and not
| > | visible? In code, how do I change its position? In code,
| > | how do enable and disable the macro?
| > |
| > |
| > | Thanks
| >
| >
| >
 
Top