1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| Private Sub CommandButton1_Click()
For Each ctrl In Me.Frame1.Controls
If TypeOf ctrl Is MSForms.CheckBox Then
If ctrl.Value = True Then
Sheets("Feuil1").Range("A65536").End(xlUp).Offset(1, 0) = TextBox1.Value
Sheets("Feuil1").Range("B65536").End(xlUp).Offset(1, 0) = TextBox2.Value
Sheets("Feuil1").Range("B65536").End(xlUp).Offset(0, 1) = ctrl.Caption
End If
End If
Next ctrl
For Each ctrl In Me.Frame2.Controls
If TypeOf ctrl Is MSForms.CheckBox Then
If ctrl.Value = True Then
Sheets("Feuil1").Range("A65536").End(xlUp).Offset(1, 0) = TextBox1.Value
Sheets("Feuil1").Range("B65536").End(xlUp).Offset(1, 0) = TextBox2.Value
Sheets("Feuil1").Range("B65536").End(xlUp).Offset(0, 2) = ctrl.Caption
End If
End If
Next ctrl
End Sub |
Partager