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()
Dim Ctrl As Control
For Each Ctrl In Controls
If TypeName(Ctrl) = "TextBox" Then Ctrl.Object.Value
If TypeName(Ctrl) = "" Then MsgBox "Veuillez renseigner les données personnelles et bancaire"
If MsgBox("confirmez-vous le paiement ?", vbYesNo, "confirmation") = vbYes Then
Worksheets("Facture").Select
Range("F5") = TextBox2.Value 'nom
Range("F6") = TextBox3.Value 'prenom
Range("B40") = TextBox4.Value 'adresse
Range("C41") = TextBox5.Value 'CP
Range("C42") = TextBox6.Value 'Ville
Unload UserFormPaiement
Sheets("Facture").Select
Else
End If
Next Ctrl
End Sub |
Partager