Private Sub Valider_Click()
a = IIf(Label12.Caption = "SAISIE DES FORMATIONS REALISEES", 3, 5)
With Sheets("Feuil" & a)
z = .Cells.Find("*", , , , xlByRows, xlPrevious).Row + 1
For y = 1 To 11: .Cells(z, y) = Controls("Te" & y).Value: Next y
For y = 1 To 5: .Cells(z, y + 11) = Controls("T" & y).Value: Next y
.Cells(z, 14) = Replace(.Cells(z, 14), ",", ".")
.Cells(z, 17) = Tb_date
.Cells(z, 18) = Tb_mois.Value
.Cells(z, 19) = Tb_semaine.Value
.Cells(z, 20) = Right(Tb_date, 4)
Cb_nomprenom = "": C1 = ""
For Each j In Controls
If TypeName(j) = "TextBox" Then j = ""
Next j
End With
With Sheets("Feuil3")
.Range("a3:t" & .Cells.Find("*", , , , , xlPrevious).Row).Sort _
Key1:=.Range("a3"), Order1:=xlAscending, Header:=xlGuess
.Range("k3:k" & .Cells(Rows.Count, "k").End(xlUp).Row).Name = "Service_réalisé"
.Range("n3:n" & .Cells(Rows.Count, "n").End(xlUp).Row).Name = "heures_réalisé"
.Range("s3:s" & .Cells(Rows.Count, "s").End(xlUp).Row).Name = "semaine_réalisé"
.Range("q3:q" & .Cells(Rows.Count, "q").End(xlUp).Row).Name = "Choix_Année_Réalisée"
End With
With Sheets("Feuil5")
.Range("a3:t" & .Cells.Find("*", , , , , xlPrevious).Row).Sort _
Key1:=.Range("o3"), Order1:=xlAscending, Header:=xlGuess
.Range("k3:k" & .Cells(Rows.Count, "k").End(xlUp).Row).Name = "Service_prévision"
.Range("n3:n" & .Cells(Rows.Count, "n").End(xlUp).Row).Name = "heures_prévision"
.Range("s3:s" & .Cells(Rows.Count, "s").End(xlUp).Row).Name = "semaine_prévision"
.Range("q3:q" & .Cells(Rows.Count, "q").End(xlUp).Row).Name = "Choix_Année_Prévision"
End With
Unload Me: Accueil.Show
End Sub