Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Great stuff! - works like a charm - thanks very much
"Michel Pierron" wrote: Hi Terry, you can use application.caller like that: Sub ShapesInit() Dim i% With Worksheets(1) For i = 1 To .Shapes.Count ..Shapes(i).OnAction = "Test" Next i End With End Sub Sub Test() Select Case Application.Caller Case "Rectangle 1" Case "Rectangle 3" '.... End Select End Sub Regards, MP "TerryP" a écrit dans le message de ... VBA - Office97 - Excel I have a routine which populates a worksheet with shapes (rectangles). Each is uniquely identified with an index number appended to its name. At he same time, the "onaction" property in set to call a common subroutine. This subroutine needs to know which shape was clicked, but the calling routine (i.e. the onaction statement) does not seem to support arguments. Does anybody know how I can identify the shape in the target subroutine after the action is triggered. Please note that it is impractical to call a different subroutine for every shape on the sheet - there are too many of them! Any assistance would be appreciated. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Call a subroutine using variable subroutine name | Excel Discussion (Misc queries) | |||
SUBROUTINE HELP | Excel Discussion (Misc queries) | |||
Every second subroutine | Excel Programming | |||
OnAction | Excel Programming | |||
.OnAction - Multiple Calls | Excel Programming |