Bonjour Zombe
Pour remplir un userform à l'ouverture, tu le fais par la procédure
Private Sub UserForm_Initialize()
TextBox3.Value = Date
TextBox4.Value = Cells(3, 5)
End Sub
Pour pouvoir cocher plusieurs choix dans la frame2, il faut des checkbox
Et pour remplir la feuille excel à partir de l'userform en appuyant sur un bouton
Private Sub CommandButton1_Click()
Dim c As Control
Dim temp As String
Cells(5, 2) = TextBox1.Value
Cells(6, 2) = TextBox2.Value
' cas des optionsButton
temp = ""
For Each c In Me.Frame1.Controls
If c.Value Then temp = c.Caption
Next c
Cells(7, 2) = temp
' cas des CheckBox
temp = ""
If CheckBox1.Value = True Then
temp = CheckBox1.Caption
End If
If CheckBox2.Value = True Then
If Len(temp) = 0 Then
temp = CheckBox2.Caption
Else
temp = temp & ", " & CheckBox2.Caption
End If
End If
If CheckBox3.Value = True Then
If Len(temp) = 0 Then
temp = CheckBox3.Caption
Else
temp = temp & ", " & CheckBox3.Caption
End If
End If
Cells(8, 2) = temp
' on cache le formulaire
Me.Hide
' on remet les données du formalaire à 0
Me.TextBox1 = ""
Me.TextBox2 = ""
For Each c In Me.Frame1.Controls
c.Value = False
Next c
For Each c In Me.Frame2.Controls
c.Value = False
Next c
End Sub
Bon WE