ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Autoshape coding (https://www.excelbanter.com/excel-programming/306472-autoshape-coding.html)

Sheldon[_3_]

Autoshape coding
 
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

William[_2_]

Autoshape coding
 
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



"Sheldon" wrote in message
...
| 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



William[_2_]

Autoshape coding
 
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



"Sheldon" wrote in message
...
| 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
|
|

|
| "Sheldon" wrote in message
| ...
| | 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
|
|
|




All times are GMT +1. The time now is 09:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com