Sub totaux()
Dim tablo As Variant
Dim i As Long, j As Byte, k As Long, s As Byte
Dim PremLig As Long, DerLig As Long, DerLig2 As Long
For s = 1 To 3
With Sheets(s)
PremLig = .Columns("A:A").Find(What:="Sce", LookAt:=xlWhole).Row + 1
DerLig = .Columns("A:D").Find(What:="Remplaçants", LookAt:=xlWhole).Row - 1
DerLig2 = .Columns("A:A").Find(What:="Total", LookAt:=xlWhole).Row - 2
tablo = .Range(.Cells(PremLig, 1), .Cells(DerLig, 32))
For i = DerLig + 2 To DerLig2 Step 2
For j = 5 To 31
If .Cells(i, j) <> "" Then
For k = 1 To UBound(tablo)
If tablo(k, 1) = .Cells(i, j) Then
tablo(k, UBound(tablo, 2)) = tablo(k, UBound(tablo, 2)) + .Cells(i + 1, j)
End If
Next k
End If
Next j
Next i
For i = 1 To UBound(tablo)
Sheets("Totaux").Cells(i + 2, s + 10) = tablo(i, UBound(tablo, 2))
Next i
Erase tablo
End With
Next s
End Sub