AW: For Schleife für Checkbox-Sichtbarkeit
10.09.2005 23:52:39
Udo
Hallo Sepp,
ich habe mal den kompleten Code kopiert:
Private Sub UserForm_Initialize()
Worksheets("Daten").Select
ComboBox4.ColumnCount = 2
ComboBox4.RowSource = "l1:l2"
ComboBox7.ColumnCount = 4
ComboBox7.RowSource = "m1:m4"
ComboBox8.RowSource = "l1:l2"
Dim i As Integer 'code von Rainer
For i = 1 To 31 'code von Rainer
Me.Controls("Checkbox" & i).Visible = False 'code von Rainer
Next 'code von Rainer
CheckBox1.Caption = Worksheets("Daten").Range("A1").Value
CheckBox2.Caption = Cells(2, 1).Value
CheckBox3.Caption = Cells(3, 1).Value
CheckBox4.Caption = Cells(4, 1).Value
CheckBox5.Caption = Cells(5, 1).Value
CheckBox6.Caption = Cells(6, 1).Value
CheckBox7.Caption = Cells(7, 1).Value
CheckBox8.Caption = Cells(8, 1).Value
CheckBox9.Caption = Cells(9, 1).Value
CheckBox10.Caption = Cells(10, 1).Value
CheckBox11.Caption = Cells(11, 1).Value
CheckBox12.Caption = Cells(12, 1).Value
CheckBox13.Caption = Cells(13, 1).Value
CheckBox14.Caption = Cells(14, 1).Value
CheckBox15.Caption = Cells(15, 1).Value
CheckBox16.Caption = Cells(16, 1).Value
CheckBox17.Caption = Cells(17, 1).Value
CheckBox18.Caption = Cells(18, 1).Value
CheckBox19.Caption = Cells(19, 1).Value
CheckBox20.Caption = Cells(20, 1).Value
CheckBox21.Caption = Cells(21, 1).Value
CheckBox22.Caption = Cells(22, 1).Value
CheckBox23.Caption = Cells(23, 1).Value
CheckBox24.Caption = Cells(24, 1).Value
CheckBox25.Caption = Cells(25, 1).Value
CheckBox26.Caption = Cells(26, 1).Value
CheckBox27.Caption = Cells(27, 1).Value
CheckBox28.Caption = Cells(28, 1).Value
CheckBox29.Caption = Cells(29, 1).Value
CheckBox30.Caption = Cells(30, 1).Value
CheckBox31.Caption = Cells(31, 1).Value
End Sub
Deine Lösung, alle CheckBoxen auszublenden ginge bestimmt auch, aber da ich auch noch andere CheckBoxen verwende wären die dann ja auch ausgeblendet.
Gruß, Udo