+ Reply to Thread
Results 1 to 2 of 2

Detect which shape was clicked?

  1. #1
    Thief_
    Guest

    Detect which shape was clicked?

    IF I have 3 autoshapes, rectangles, on a worksheet, how do I detect which
    shape was clicked by the user so that I can, say, delete it or change its
    properties?

    --
    |
    +-- Thief_
    |



  2. #2
    Rob Bovey
    Guest

    Re: Detect which shape was clicked?

    "Thief_" <thief_@hotmail.com> wrote in message
    news:%23SeKg2NiFHA.3056@TK2MSFTNGP10.phx.gbl...
    > IF I have 3 autoshapes, rectangles, on a worksheet, how do I detect which
    > shape was clicked by the user so that I can, say, delete it or change its
    > properties?


    If you assign the same macro to all of them, Application.Caller will
    return the name of the shape that fired the macro. You can then use
    Worksheets("Whatever").Shapes("CallerName") to get an object reference to
    that shape.

    --
    Rob Bovey, Excel MVP
    Application Professionals
    http://www.appspro.com/

    * Take your Excel development skills to the next level.
    * Professional Excel Development
    http://www.appspro.com/Books/Books.htm



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1