On va trouver. Il doit y avoir une petite différence vu que tu es sur Mac.
Essaie comme ça :
Sub Tache()
'
' Taches1 Macro
'
'
Dim C As Range, Tbl As Variant, Arr(4), Mois, arrAn As Variant
'dim Sem as integer
arrAn = Array("janvier", "fevrier", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre")
i = Application.Caller
i = CInt(ActiveSheet.Shapes(i).DrawingObject.Caption)
Mois = Application.Index(arrAn, i)
Set Mois = Application.Index([F4:BB4], Application.Match(Mois, [F4:BB4], 0))
sem = Mois.MergeArea.Count
' Tbl = [F1:J130]
Tbl = Cells(1, Mois.Column).Resize(130, sem)
[GZ:GZ] = ""
With Range("GZ5:GZ130")
.Select
.AutoFilter
For Each C In [B6:B130]
For i = 1 To sem
If IsNumeric(Application.Match(UCase(Tbl(C.Row, i)), Array("S", "SD", "RE", "P", "R"), 0)) Then
Cells(C.Row, "GZ") = 1
End If
Next i
Next C
.AutoFilter 1, 1
End With
Range("H:BG,BI:FW").EntireColumn.Hidden = True
Range("H:BG,BI:FW,GB:GB,GG:GQ,GT:GY").EntireColumn.Hidden = True
End Sub
Sinon, comme ça :
Sub Tache()
'
' Taches1 Macro
'
'
Dim C As Range, Tbl As Variant, Arr(4), Mois, arrAn As Variant
'dim Sem as integer
arrAn = Array("janvier", "fevrier", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre")
i = Application.Caller
i = CInt(ActiveSheet.Shapes(i).DrawingObject.Caption)
Mois = Application.Index(arrAn, i)
Set Mois = Application.Index([F4:BB4], Application.Match(Mois, [F4:BB4], 0))
sem = Mois.MergeArea.Count
' Tbl = [F1:J130]
Tbl = Cells(1, Mois.Column).Resize(130, sem)
[GZ:GZ] = ""
With Range("GZ5:GZ130")
ActiveSheet.AutoFilterMode = False
For Each C In [B6:B130]
For i = 1 To sem
If IsNumeric(Application.Match(UCase(Tbl(C.Row, i)), Array("S", "SD", "RE", "P", "R"), 0)) Then
Cells(C.Row, "GZ") = 1
End If
Next i
Next C
.AutoFilter 1, 1
End With
Range("H:BG,BI:FW").EntireColumn.Hidden = True
Range("H:BG,BI:FW,GB:GB,GG:GQ,GT:GY").EntireColumn.Hidden = True
End Sub
Daniel