Private Sub BTN_Valider_Click()
Dim derlig As Long
With Sheets("BD_Personnel")
'On teste la saisie du nom ..
If Me.Text_Nom.Text = "" Then
MsgBox "vous devez saisir un nom!"
Me.Text_Nom.SetFocus
Exit Sub
End If
'On teste la saisie du prénom ..
If Me.Text_Prenom.Text = "" Then
MsgBox "vous devez saisir un prénom!"
Me.Text_Prenom.SetFocus
Exit Sub
End If
derlig = .Range("A" & Rows.Count).End(xlUp).Row + 1
.Cells(derlig, 1).Value = UCase(Text_Nom) 'ucase permet de mettre en majuscule
.Cells(derlig, 2).Value = Application.Proper(Text_Prenom) 'permet de mettre la première lettre en majuscule
.Cells(derlig, 3).Value = ComboBox_Grade
.Cells(derlig, 4).Value = Text_Matricule
.Cells(derlig, 5).Value = Text_Adresse
.Cells(derlig, 6).Value = Format(Text_Codepostal, "00000") 'format code postal
.Cells(derlig, 7).Value = UCase(Text_Ville)
.Cells(derlig, 8).Value = Format(Me.Text_Téléphone, "0#"" ""##"" ""##"" ""##"" ""##")
.Cells(derlig, 9).Value = IMG_Personne
End With
End Sub