Event triggered when a shape is moved

justin-uk

New Member
Joined
Dec 3, 2007
Messages
21
I have searched the forums for an answer to this and haven't found anything, but I am forever hopeful!

Is there a way to trigger a macro when a shape is moved by the user? If I set the OnAction property for a shape, then the cursor changes to a hand when it is over the shape, and I can detect a mouse click on the shape, but I cannot drag and drop the shape. If I reset the OnAction property to "" (empty quotes), then I can drag and drop again within the worksheet, but I can't trigger the macro.

Worksheet_Change or Worksheet_SelectionChange are not triggered by this event.

People have suggested using timers to continuously poll the shapes and determine their locations, but is there an easier way?

What I am trying to do is create a sheet where the user can visually move around objects (in this case representing employees) and deposit them in various zones. The spreadsheet would then apply certain attributes to the shape i.e. change colour according to where the shape is and if it is in an unsuitable zone. I can do all of this, but I want it to work the instant the shape is moved, not rely on the user to hit a button.

Thanks,

Justin
 
Even if it means that you can help me do the following

When a couple of specific shapes is dragged into the drag area (shape) I want to fire off a macro and also change the mouse cursor to the hand signal when i am over the shapes that can be dragged

Thank you

if possible - once the shape is dragged into the drag area, i want to hide this dragto area and display my gif file named - loading.gif
 
Upvote 0
Even if it means that you can help me do the following

When a couple of specific shapes is dragged into the drag area (shape) I want to fire off a macro and also change the mouse cursor to the hand signal when i am over the shapes that can be dragged

Thank you

if possible - once the shape is dragged into the drag area, i want to hide this dragto area and display my gif file named - loading.gif

Take a look here and see if you can adpat the code to meet your specific needs : https://www.mrexcel.com/forum/excel...-when-shape-moved-shapemove-pseudo-event.html
 
Last edited:
Upvote 0
Hi Jaafar - thank you

i think im doing something wrong somewhere.

For me, i only need it to trigger the shape move and drop on certain shapes

At the min, it appears to be pulling info when any shaped is dragged
 
Upvote 0
Hi Jaafar - thank you

i think im doing something wrong somewhere.

For me, i only need it to trigger the shape move and drop on certain shapes

At the min, it appears to be pulling info when any shaped is dragged

Hi mahmed1,

Just to let you know that I sent a private message to you but it seems that your inbox cannot accept further messages because it is full.
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top