Option Explicit
Private Sub optButton1_Click()
Dim optBut
Const strOptionName As String = "optButton1"
' print the sheet name
Debug.Print Me.Name
' loop through the shapes in the worksheet
For Each optBut In Me.Shapes
' print the shape name
Debug.Print optBut.Name
Next
' print the name of a specific shape
Debug.Print Me.Shapes("optButton1").Name
' print the name of a specific shape using variable
Debug.Print Me.Shapes(strOptionName).Name
' print the value
Debug.Print Me.OLEObjects(strOptionName).Object.Value
End Sub
Regards, TMS
Bookmarks