ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA in Excel 2003 (https://www.excelbanter.com/excel-programming/341321-vba-excel-2003-a.html)

MarkBradshaw

VBA in Excel 2003
 
I am trying to write a small little macro in VBA that upon clicking a button
resizes,
moves and rotates a picture or autoshape on the active sheet.

I have found; .Left .Top .Height .Width properties without problem but after
30mins searching I still am at a loss as to how programmatically to rotate an
object.

I.e. for the sake of an easy example using defined numbers:

With ActiveSheet.DrawingObjects("AutoShape 10")
.Left = 200
.Top = 200
.Width = 50
.Height = 50
End With

How do i rotate the autoshape? .Rotate or .Angle would make sense but
apparently
don't exist...

Thanks in advance,

Mark

NickHK

VBA in Excel 2003
 
Mark,
Refer to it as:
With ActiveSheet.Shapes("AutoShape 2")
.Rotation = 45
or .IncrementRotation -45
etc

Nick

"MarkBradshaw" wrote in message
...
I am trying to write a small little macro in VBA that upon clicking a

button
resizes,
moves and rotates a picture or autoshape on the active sheet.

I have found; .Left .Top .Height .Width properties without problem but

after
30mins searching I still am at a loss as to how programmatically to rotate

an
object.

I.e. for the sake of an easy example using defined numbers:

With ActiveSheet.DrawingObjects("AutoShape 10")
.Left = 200
.Top = 200
.Width = 50
.Height = 50
End With

How do i rotate the autoshape? .Rotate or .Angle would make sense but
apparently
don't exist...

Thanks in advance,

Mark




MarkBradshaw

VBA in Excel 2003
 
Thanks a lot Nick,

Knew it had to be something simple I was missing!

"NickHK" wrote:

Mark,
Refer to it as:
With ActiveSheet.Shapes("AutoShape 2")
.Rotation = 45
or .IncrementRotation -45
etc

Nick

"MarkBradshaw" wrote in message
...
I am trying to write a small little macro in VBA that upon clicking a

button
resizes,
moves and rotates a picture or autoshape on the active sheet.

I have found; .Left .Top .Height .Width properties without problem but

after
30mins searching I still am at a loss as to how programmatically to rotate

an
object.

I.e. for the sake of an easy example using defined numbers:

With ActiveSheet.DrawingObjects("AutoShape 10")
.Left = 200
.Top = 200
.Width = 50
.Height = 50
End With

How do i rotate the autoshape? .Rotate or .Angle would make sense but
apparently
don't exist...

Thanks in advance,

Mark






All times are GMT +1. The time now is 07:18 PM.

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