Bonjour à tous,
Je bloque depuis plusieurs jour sur ce code appartenant à un UseForm,
Je précise que je suis relativement débutant,
Merci vous
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(RueText)
End Sub
Private Sub CPVille_Change()
CP.Value = Format(CP.Value, "00"" ""000")
End Sub
Private Sub Mail_AfterUpdate()
Mail = UCase(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
Je bloque depuis plusieurs jour sur ce code appartenant à un UseForm,
Je précise que je suis relativement débutant,
Merci vous
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(RueText)
End Sub
Private Sub CPVille_Change()
CP.Value = Format(CP.Value, "00"" ""000")
End Sub
Private Sub Mail_AfterUpdate()
Mail = UCase(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