Hm, gibt es einen Grund warum du nicht einfach
Tabelle11.Shapes("Schloss12.1").Visible = True
schreibst?
ich würde dann auch kein ActiveX-Control nehmen, sondern ein Form-Control und jedem davon ein und das selbe Makro zuweisen.
'Tabelle11
Option Explicit
Sub CheckBox_Click()
If TypeName(Application.Caller) <> "String" Then Exit Sub
Dim shp As Excel.Shape
On Error Resume Next
Set shp = Shapes(Application.Caller)
On Error GoTo 0
If shp.Type <> msoFormControl Then Exit Sub
If shp.FormControlType <> xlCheckBox Then Exit Sub
'Bsp: shp.Name = "12.1"
'Tabelle11.Shapes("Schloss" & shp.Name).Visible = True
End Sub
Noch bissl Fehlerbehandlung dazu (falls ein Shape unter nem Namen nicht vorhanden sein sollte, dann einfach ne Meldung ausgeben) und fertig.
|