Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default Detect which shape was clicked?

"Thief_" wrote in message
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
enter time when shape is clicked Dgwood90 Excel Discussion (Misc queries) 1 October 15th 08 10:31 AM
How can I detect that an excel cell has been clicked Ballantine Excel Discussion (Misc queries) 5 August 14th 08 10:09 AM
How to detect optionbutton being clicked? crapit Excel Programming 13 July 5th 04 12:20 PM
How to tell wich object/shape was clicked Andrew Ofthesong Excel Programming 2 December 1st 03 05:05 PM
detecting shape clicked on notsureofthatinfo Excel Programming 1 October 15th 03 07:46 AM


All times are GMT +1. The time now is 05:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"