Private Sub CommandButton1_Click()
Dim TabTemp As Variant
Dim Derlgn As Integer, Derlgn2 As Integer, L As Integer
Dim C As Byte, j As Byte
With Worksheets("Saisie")
.Unprotect
Derlgn = .Range("B65536").End(xlUp).Row 'B car il y a des formules dans la colonne A
If Derlgn = 3 Then Derlgn = 4
TabTemp = .Range(.Cells(4, 1), .Cells(Derlgn, 18)).Value 'ici le 18 représente la derniere colonne prise en compte
'.Range(Cells(4, 1), Cells(Derlgn, 18)).ClearContents 'ici aussi
.Protect
End With
With Worksheets("Traitement")
.Unprotect
Derlgn2 = .Range("A65536").End(xlUp).Row 'détecte la derniere ligne non vide
For L = 1 To UBound(TabTemp, 1) 'pour chaque ligne du tableau
For C = 1 To UBound(TabTemp, 2) 'pour chaque Colonne du tableau
If TabTemp(1, 1) = "" Then Exit Sub 'On sort si pas de données
.Cells(Derlgn2 + L, C) = TabTemp(L, C) 'ici on colle les données
Next
Next
Derlgn2 = .Range("A65536").End(xlUp).Row + 1 'détecte la derniere ligne vide
For j = 9 To 14
.Cells(Derlgn2, j).Value = Application.WorksheetFunction.Sum(.Range(.Cells(.Cells(Derlgn2, j).Offset(-UBound(TabTemp, 1), 0).Row, j), .Cells(Derlgn2 - 1, j)))
Next j
.Protect
End With
End Sub