ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   XL2000: Shape object events (https://www.excelbanter.com/excel-programming/280283-xl2000-shape-object-events.html)

GSQUARED

XL2000: Shape object events
 
Hi,

I have several Rectangle shapes on a worksheet. I would like to assign
a generic macro (sub) to each of them, but using the Name of the shape
in the macro.


i.e. objShape1, ObjShape2 two shape objects
assign macro : Generic_Macro to both

Sub Generic_Macro()
MsgBox <triggeringshape.Name
End Sub

can this be done? Or could I "morph" a rectangular shape object in a
class module and write some special event for the OnAction event of
the shape?

Question 2: is there any way to have a MouseOver event triggered for a
Shape?


Thanks in advance!
Gyula
PS: please email to

Tim Aurthur

XL2000: Shape object events
 
Try this:

MsgBox Application.Caller



"GSQUARED" wrote in message
om...
Hi,

I have several Rectangle shapes on a worksheet. I would like to assign
a generic macro (sub) to each of them, but using the Name of the shape
in the macro.


i.e. objShape1, ObjShape2 two shape objects
assign macro : Generic_Macro to both

Sub Generic_Macro()
MsgBox <triggeringshape.Name
End Sub

can this be done? Or could I "morph" a rectangular shape object in a
class module and write some special event for the OnAction event of
the shape?

Question 2: is there any way to have a MouseOver event triggered for a
Shape?


Thanks in advance!
Gyula
PS: please email to





All times are GMT +1. The time now is 09:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com