Consulting

Results 1 to 17 of 17

Thread: Solved: Double Click Event for Shapes

  1. #1
    VBAX Tutor
    Joined
    Jun 2005
    Posts
    210
    Location

    Solved: Double Click Event for Shapes

    Hello,

    Is there something like a double click event for shapes.I have a sheet that contains more than 1000 shapes. By clicking twice on a shape, a procedure should start. Untill now i made use of:
    - myShapeObj.OnAction = "procedure" and
    - ActiveSheet.Shapes(Application.Caller), but this fires the procedure with only one
    click on a shape, and thats not what i want this time. Any help is appreciated.
    Thanks in advance

    Stranno

  2. #2
    Knowledge Base Approver VBAX Guru
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    4,784
    I think that's difficult or impossible with Autoshapes, but if the shapes are simple shapes they could be swapped for another control type which has events (such as an ActiveX Label) by a run-once macro, then it's not too difficult to assign any number of these to a collection and they will all respond to a doubleclick by running a single sub in the class module. John Walkenbach does this here but this can be adapted to work in a similar way with labels on a sheet.

    Double-clicking on any of the three coloured Labels (they look like shapes) in the attached results in calling the same code but recognises which Label has been double-clicked.
    Attached Files Attached Files
    Last edited by p45cal; 02-24-2013 at 06:42 PM.
    p45cal - - - - -This is my signature, it appears after all my posts. Below is not directed at anyone in particular - so don't take offence! - (You might guess why it's there though)
    If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  3. #3
    VBAX Tutor
    Joined
    Jun 2005
    Posts
    210
    Location
    In fact the shapes are charts. No simple shapes i am afraid. Nevertheless thanks for your response.

  4. #4
    Knowledge Base Approver VBAX Guru
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    4,784
    Quote Originally Posted by stranno
    In fact the shapes are charts. No simple shapes i am afraid. Nevertheless thanks for your response.
    1000 charts! Wow! But that's good news, 'cos if they're full bown charts, they can have events in the same way as Labels had in the last attachment. I'll put together some code for a few charts later on tonight.
    p45cal - - - - -This is my signature, it appears after all my posts. Below is not directed at anyone in particular - so don't take offence! - (You might guess why it's there though)
    If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  5. #5
    Knowledge Base Approver VBAX Guru
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    4,784
    Just added the chart double-click event to the embedded charts in the attached.
    Attached Files Attached Files
    p45cal - - - - -This is my signature, it appears after all my posts. Below is not directed at anyone in particular - so don't take offence! - (You might guess why it's there though)
    If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  6. #6
    VBAX Tutor
    Joined
    Jun 2005
    Posts
    210
    Location
    Hi P45cal, Thank you very much. It seems that i first have to write something before i can open the attachement. I Will soon let you know if it works for me.
    Stranno

  7. #7
    VBAX Tutor
    Joined
    Jun 2005
    Posts
    210
    Location
    Hi P45cal,

    Yep, Problem solved. It works like a charm. Thanks again.

    Stranno

  8. #8
    I really want to see your answer. And for that I have to post something.

  9. #9
    I Loved it, thank you!!

  10. #10
    VBAX Newbie
    Joined
    Mar 2014
    Posts
    1
    Location
    Quote Originally Posted by diogoakira View Post
    I really want to see your answer. And for that I have to post something.
    me too.Many thanks

  11. #11
    will check!

  12. #12

  13. #13
    VBAX Newbie
    Joined
    Dec 2015
    Posts
    1
    Location
    thanks

  14. #14
    thank you!

  15. #15
    VBAX Newbie
    Joined
    Jan 2017
    Posts
    1
    Location
    Thank you, looks hopeful !

  16. #16
    VBAX Newbie
    Joined
    Mar 2018
    Posts
    1
    Location

    Lightbulb

    Quote Originally Posted by p45cal View Post
    Just added the chart double-click event to the embedded charts in the attached.
    Excel-lent

  17. #17
    VBAX Tutor
    Joined
    Jun 2005
    Posts
    210
    Location

    Quote Originally Posted by d.b View Post
    Excel-lent

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •