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?

Thanks.

--
|
+-- Thief_
|


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Detect which shape was clicked....

Hi Thief,

Try assigning ththe following macro to each of thre rectangles:

Sub TestRectangles()

Select Case Application.Caller
Case "Rectangle 1"
'Do something
MsgBox Application.Caller '<<=== Demo only
Case "Rectangle 2"
'Do something
MsgBox Application.Caller '<<=== Demo only
Case "Rectangle 3"
'Do something
MsgBox Application.Caller '<<=== Demo only
End Select

End Sub


Change the names of the rectangles to accord with your names.

Replace the 'Do something lines with your desired actions.

The MsgBox lines are purely for demo purposes; click the rectangles and
test.


---
Regards,
Norman



"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?

Thanks.

--
|
+-- Thief_
|




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Detect which shape was clicked....

TOP post Norman!!

--
|
+-- Thief_
|

"Norman Jones" wrote in message
...
Hi Thief,

Try assigning ththe following macro to each of thre rectangles:

Sub TestRectangles()

Select Case Application.Caller
Case "Rectangle 1"
'Do something
MsgBox Application.Caller '<<=== Demo only
Case "Rectangle 2"
'Do something
MsgBox Application.Caller '<<=== Demo only
Case "Rectangle 3"
'Do something
MsgBox Application.Caller '<<=== Demo only
End Select

End Sub


Change the names of the rectangles to accord with your names.

Replace the 'Do something lines with your desired actions.

The MsgBox lines are purely for demo purposes; click the rectangles and
test.


---
Regards,
Norman



"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?

Thanks.

--
|
+-- Thief_
|






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
How can I detect that an excel cell has been clicked Ballantine Excel Discussion (Misc queries) 5 August 14th 08 10:09 AM
Detect which shape was clicked? Thief_ Excel Programming 1 July 15th 05 03:53 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 11:38 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"