If doing it programmatically, you could pass the shape name (or whatever) to the subroutine as a parameter. By making the parameter optional in the subroutine, you can still call it from clicking on shapes.
Code:Option Explicit Sub AppCaller(Optional Param As Variant) On Error GoTo ErrHandler Dim ShapeSelection As String If IsMissing(Param) Then ShapeSelection = Application.Caller Else ShapeSelection = CStr(Param) End If Select Case ShapeSelection Case "shp1" DoSomething1 Case "shp2" DoSomething2 Case Else MsgBox ShapeSelection End Select ErrHandler: If Err.Number <> 0 Then MsgBox Err.Number & vbNewLine & Err.Description End Sub Sub DoSomething1() MsgBox "Do something one way" End Sub Sub DoSomething2() MsgBox "Do something another way" End Sub Sub Problem() AppCaller End Sub Sub OnePossibility() AppCaller "Pass the name of the shape as a parameter?" End Sub




Reply With Quote