Bonjour à tous,
Je crée un formulaire de saisie et je n'arrive pas à insérer du texte en colonne L selon la checkbox cochée.
Je m'explique :
Si je coche la ChecBox1 je désir que s'inscrive en colonne L Particulier
Si je coche la ChecBox2 je désir que s'inscrive en colonne L Professionnel
Si je coche la ChecBox3 je désir que s'inscrive en colonne L Commerçant
Voici mon code :
Private Sub CommandButton2_Click()
Dim ligne As Integer
If MsgBox("confirmez-vous l'ajout des données?", vbYesNo, "confirmation") = vbYes Then
Worksheets("Inscriptions").Select
ligne = Sheets("Inscriptions").Range("B456541").End(xlUp).Row + 1
Cells(ligne, 2) = TextBox1.Value ' Nom
Cells(ligne, 4) = TextBox2.Value ' Prénom
Cells(ligne, 5) = TextBox3.Value ' Adresse
Cells(ligne, 6) = TextBox4.Value ' Code postal
Cells(ligne, 8) = TextBox5.Value ' Ville
Cells(ligne, 9) = TextBox6.Value ' Tel fixe
Cells(ligne, 10) = TextBox7.Value ' Tel portable
Cells(ligne, 11) = TextBox8.Value ' Email
Cells(ligne, 12) = checkBox1 = "Particulier" ' Ecrit Particulier
Else
End If
End Sub
Merci pour votre aide
Robert