Option Explicit
Sub Test()
Dim objCheckBox As Object
For x = 201 To 205
Set objCheckBox = ActiveSheet.Shapes("Check Box " & x)
Select Case objCheckBox.ControlFormat.Value
Case xlOn
MsgBox objCheckBox.Name & " = xlOn"
Case xlOff
MsgBox objCheckBox.Name & " = xlOff"
Case xlMixed
MsgBox objCheckBox.Name & " = xlMixed"
End Select
Next
End Sub
Was du allerdings vor hast, ist komplett unklar - Formula ist keine Eigenschaft einer CheckBox (sondern von Range).
Immer wieder habe ich Verständnisprobleme was die variable Gestaltung in VBA anbelangt.
z.B. Tabelle1.Range("A1") -->wie zähle ich hier variabel hoch -->Tabelle1.Range("A" & x)???
Range("A" & x)
Cells(x, "A")
Cells(x, 1)
Such dir eines davon aus.
Wenn x einen Offset darstellt, dann noch per Range.Offset
Range("A1").Offset(x, 0) 'mit x=1 wäre das A2 - das bedeutet eine (1) Zeile tiefer, und 0 Spalten nach rechts
Grüße
|