Bonjour,
Voila mon code qui parlera mieux que moi, il sagit de mettre une option bouton et un textbox dans une même celullle (E9) ex. Madame Dupont Je chercher a ajouter une ligne aprés chaque validation.
Private Sub CommandButton1_Click()
Unload UserForm1
End Sub
Private Sub OptionButton1_Change()
Cells(9, 5) = "Monsieur " & TextBox1.Value
End Sub
Private Sub OptionButton2_Change()
Cells(9, 5) = "Madame " & TextBox1.Value
End Sub
Private Sub OptionButton3_Change()
Cells(9, 5) = "Mademoiselle " & TextBox1.Value
End Sub
Private Sub TextBox1_Change()
Dim Ctrl As Control
For Each Ctrl In Frame1.Controls
If Ctrl.Object.Value = True Then
Cells(9, 5) = Ctrl.Caption & " " & TextBox1.Value
End If
Next Ctrl
End Sub
Private Sub UserForm_Initialize()
Dim monNom As String
monNom = Cells(1, 1).Value
If Left(monNom, 9) = "Monsieur " Then monNom = Right(monNom, Len(monNom) - 9): OptionButton1.Value = True
If Left(monNom, 7) = "Madame " Then monNom = Right(monNom, Len(monNom) - 7): OptionButton2.Value = True
If Left(monNom, 13) = "Mademoiselle " Then monNom = Right(monNom, Len(monNom) - 13): OptionButton3.Value = True
TextBox1 = monNom
End Sub
merci d'avance.
Cordialement
Max