Sub Bouton2_Clic()
Dim shp As Shape
'Contrôler si c'est bien un objet shape qui a appelé la macro
If TypeName(Application.Caller) <> "String" Then GoTo Fin
On Error GoTo Fin
With ActiveSheet.Shapes(Application.Caller)
MsgBox "Ligne: " & .TopLeftCell.Row & vbCrLf & "Colonne: " & .TopLeftCell.Column
End With
Fin:
End Sub
Private Sub CommandButton1_Click()
With CommandButton1
MsgBox "Ligne: " & .ShapeRange(1).TopLeftCell.Row & vbCrLf & "Colonne: " & .ShapeRange(1).TopLeftCell.Column
End With
End Sub