Sub
Zählen()
Dim
i
As
Integer
Dim
j
As
Integer
Dim
strCheckbox
As
String
Dim
strZeile
As
String
Dim
intAnzahl
As
Integer
Dim
objOLE
As
OLEObject
Dim
strName
As
String
For
Each
objOLE
In
Worksheets(
"Tabelle1"
).OLEObjects
If
Left(objOLE.Name, 8) =
"CheckBox"
Then
intAnzahl = intAnzahl + 1
End
If
Next
MsgBox intAnzahl
i = 1
j = 1
Do
strZeile =
"F"
& 3 + i
strCheckbox =
"Checkbox"
& i
MsgBox strCheckbox
If
Tabelle1.OLEObjects(strCheckbox).
Object
.Value =
True
Then
ActiveSheet.Range(strZeile).Value = j
j = j + 1
Else
ActiveSheet.Range(strZeile).Value =
""
End
If
i = i + 1
Loop
Until
intAnzahl + 1 = i
End
Sub