1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| Private Sub CommandButton1_Click()
Dim Ctrl As Control
Dim ToutOk As Boolean
ToutOk = True
For Each Ctrl In Controls
If TypeName(Ctrl) = "TextBox" Then
If Ctrl = "" Then
ToutOk = False
Exit For
End If
End If
Next Ctrl
If ToutOk = True Then
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
End If
Else
If Ctrl = "" Then MsgBox "Veuillez renseigner les données personnelles et bancaire"
End If
End Sub |
Partager