Private Sub CommandButton1_Click()
.................................
'Ici c'est le report de la saisie dans la feuille
With Sheets("LISTE") ' si on utlise cette ligne, il faut mettre un pint devant range
.Range("a" & L).Value = TextBox1.Value 'PRIX à copier aussi sur sept et oct en A
.Range("c" & L).Value = TextBox2.Value 'nom à copier sur sept et oct en C
.Range("g" & L).Value = TextBox5.Value 'tel fixe
.Range("h" & L).Value = TextBox6.Value 'adresse
.Range("i" & L).Value = TextBox7.Value 'instit
.Range("j" & L).Value = TextBox8.Value 'portable
.Range("d" & L).Value = ListBox1.Value 'mt cp à copier sur sept et oct en D
.Range("E" & L).Value = TextBox4.Value ' A P à copier sur sept et oct en E
' ici je range par ordre alphabétique
.Range("C4").Select
Range("A2:M275").Sort Key1:=Range("C9"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("D10").Select
'ici je remets le curseur en textbox1
TextBox1.SetFocus
End With
Dim Sh As Worksheet
For Each Sh In Worksheets
If Sh.Name <> "liste" Then
With Sheets(Sh.Name)
L = .Range("A65536").End(xlUp).Row + 1
.Range("a" & L).Value = TextBox1.Value 'PRIX à copier aussi sur sept et oct en A
.Range("b" & L).Value = TextBox2.Value 'nom à copier sur sept et oct en C
.Range("c" & L).Value = ListBox1.Value 'mt cp à copier sur sept et oct en D
.Range("d" & L).Value = TextBox4.Value
.Cells.Sort _
Key1:=.Range("B2"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End With
End If
Next Sh
'Ici je vide les TextBox
TextBox1.Value = ""
TextBox2.Value = ""
TextBox4.Value = ""
TextBox5.Value = ""
TextBox6.Value = ""
TextBox7.Value = ""
TextBox8.Value = ""
ListBox1.Value = ""
End Sub