Sub
test_formular()
Dim
names()
As
Variant
Dim
shp
As
Excel.Shape
Dim
i
As
Long
On
Error
GoTo
ErrHandler
With
Worksheets(
"Lists"
)
names = Array(
"I1:I33"
)
With
Worksheets(
"Checklist Structure"
)
For
Each
shp
In
.Shapes
If
shp.Type = msoFormControl
Then
If
shp.FormControlType = xlCheckBox
Then
If
i <= UBound(names)
Then
Debug.Print Format$(i + 1,
"00"
) &
": "
& shp.OLEFormat.
Object
.Caption &
" => "
& names(i)
shp.OLEFormat.
Object
.Caption = names(i)
i = i + 1
Else
Exit
For
End
If
End
If
End
If
Next
If
i > 0
Then
Call
MsgBox(
"Fertig"
, vbInformation)
Else
Call
MsgBox(
"keine Treffer"
, vbInformation)
End
If
End
With
End
With
Exit
Sub
ErrHandler:
Call
MsgBox(Err.Description, vbCritical,
"Fehler "
& Err.number)
End
Sub