Private Sub Worksheet_Activate()
Dim r As Range, cc%, cible As Range, lig As Variant, i&, j%, w As Worksheet, v
Application.ScreenUpdating = False
Application.EnableEvents = False 'désactive les évènements
On Error Resume Next
Set r = [A1:M23] 'à adapter au besoin
r.Clear 'RAZ
Sheets(CStr([O1])).Range(r.Address).Copy r
Set r = [B26:M29] 'à adapter au besoin
r.ClearContents 'RAZ
cc = r.Columns.Count
For Each cible In IIf(UCase([R1]) = "TOUS", [S2:S5], [R1]) 'S2:S5 à adapter au besoin
lig = Application.Match(cible, [A:A], 0)
For i = 1 To r.Rows.Count
For j = 1 To cc
For Each w In Worksheets
If Right(w.Name, 4) Like "####" Then
v = w.Cells(lig + i, j + 1)
If IsNumeric(CStr(v)) Then r(i, j) = r(i, j) + CDbl(v)
End If
Next w, j, i, cible
Application.EnableEvents = True 'réactive les évènements
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Worksheet_Activate 'lance la macro
End Sub