ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Object Movement (https://www.excelbanter.com/excel-programming/350750-object-movement.html)

Kev Eames

Object Movement
 
Can Anyone help

I need to get an image to move around an active window on activation of
the Excel sheet.

Thanking you in antisipation

Kev


JNW

Object Movement
 
Can you clarify "move around"?

"Kev Eames" wrote:

Can Anyone help

I need to get an image to move around an active window on activation of
the Excel sheet.

Thanking you in antisipation

Kev



Executor

Object Movement
 
Hi Kev,

Add you image to the sheet and give it a name eg: MoveAround.

Create for this sheet the next macro

Private Sub Worksheet_Activate()
ActiveSheet.Shapes("MoveAround").Select
Dim p As Double
Dim s As Integer

p = 3.14159265359 / 180
For s = 0 To 360
Selection.Left = 100 + Sin(s * p) * 90
Selection.Top = 100 + Cos(s * p) * 90
Next
End Sub

Hoop this helps

Executor


Kev[_6_]

Object Movement
 

Hi

Thanks very much, works a treat (The Muts Nuts)

Kev



*** Sent via Developersdex http://www.developersdex.com ***


All times are GMT +1. The time now is 07:28 AM.

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