Re : calcul de l'age dans un USF
Re
voila le code,dont je valide les données vers ma feuille,ne fait pas attention
si rien n'est repéré
Private Sub CommandButton4_Click()
Dim Msg1 As String
Dim MSG2 As String
Dim L2 As Integer
If TextBox10 = "" Then
MsgBox "Veuillez rentré un nom ? ", vbCritical, "Validation Erreur"
Exit Sub
End If
Msg1 = MsgBox("Voulez-vous ajouter cette nouvelle entrée ? " _
& vbCrLf & vbCrLf & vbTab & "Nom : " & vbTab & TextBox10 _
& vbCrLf & vbCrLf & vbTab & "Prénon : " & vbTab & TextBox11 _
& vbCrLf & vbCrLf & vbTab & "Date de Naissance : " & vbTab & TextBox13 _
& vbCrLf & vbCrLf & vbTab & "Père: " & vbTab & TextBox1 _
& vbCrLf & vbCrLf & vbTab & "Mère : " & vbTab & TextBox3 _
& vbCrLf & vbCrLf & vbTab & "Employeur : " & vbTab & TextBox7, vbYesNo, "Nouveau Validation")
If Msg1 = vbYes Then
L2 = Sheets("base").Range("A65536").End(xlUp).Row + 1
With Sheets("base")
.Range("G" & L2).Value = TextBox1.Value
.Range("I" & L2).Value = TextBox2.Value
.Range("H" & L2).Value = TextBox3.Value
.Range("J" & L2).Value = TextBox7.Value
.Range("K" & L2).Value = TextBox9.Value
.Range("L" & L2).Value = TextBox8.Value
.Range("A" & L2).Value = TextBox10.Value
.Range("B" & L2).Value = TextBox11.Value
.Range("C" & L2).Value = TextBox12.Value
.Range("E" & L2).Value = TextBox13.Value
.Range("D" & L2).Value = ComboBox1.Value
.Range("F" & L2).Value = TextBox14.Value 'textbox age
End With
Else: TextBox3 = ""
End If
MSG2 = MsgBox("Voulez-vous continuer pour d'autres nouvelles entrées ?", _
vbYesNo, "Nouveau Continuer ?")
If MSG2 = vbYes Then
TextBox1 = ""
TextBox2 = ""
TextBox3 = ""
TextBox7 = ""
TextBox8 = ""
TextBox9 = ""
TextBox10 = ""
TextBox11 = ""
TextBox12 = ""
TextBox13 = ""
TextBox14 = ""
TextBox12.SetFocus
Else
Unload Me
UserForm1.Show
End If
End Sub
petchy