Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can I detect that an excel cell has been clicked | Excel Discussion (Misc queries) | |||
Detect which shape was clicked? | Excel Programming | |||
How to detect optionbutton being clicked? | Excel Programming | |||
How to tell wich object/shape was clicked | Excel Programming | |||
detecting shape clicked on | Excel Programming |