Option Explicit
Private Sub Contact_Change()
Contact.Value = UCase(Contact.Value)
End Sub
Private Sub Societe_Change()
Societe.Value = Application.WorksheetFunction.Proper(Societe.Value)
End Sub
Private Sub Rue_Change()
Rue.Text = Application.WorksheetFunction.Proper(Rue.Value)
End Sub
Private Sub CPVille_Change()
CPVille.Value = Format(CPVille.Value, "00"" ""000")
End Sub
Private Sub Mail_AfterUpdate()
Mail = LCase(Mail)
End Sub
Private Sub Tel_AfterUpdate()
Tel.Value = Format(Tel.Value, "00"" ""00"" ""00"" ""00"" ""00")
End Sub
Private Sub CommandButton1_Click() ' VALIDER
Dim ligne As Integer
Sheets("CLIENTS").Select
ligne = Range("C200").End(xlUp).Row + 1
Range("C" & ligne).Value = Contact.Value
Range("D" & ligne).Value = Societe.Value
Range("E" & ligne).Value = Rue.Value
Range("F" & ligne).Value = CPVille.Value
Range("G" & ligne).Value = Mail.Value
Range("H" & ligne).Value = Tel.Value
Unload Me
Range("C10:H" & Range("C65536").End(xlUp).Row).Select
Selection.Sort Key1:=Range("C10"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=True, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("A1").Select
UserForm.Show
End Sub
Private Sub CommandButton2_Click()
Unload Me
Sheets("CLIENTS").Select
End Sub