Function ChampActif(c)
Application.Volatile
ChampActif = Sheets(Application.Caller.Parent.Name).AutoFilter.Filters.Item(c.Column - Sheets(Application.Caller.Parent.Name).Range("_FilterDataBase").Column + 1).On
End Function
Function FiltreCol(Champ As Range, TitreChamp As Range)
Application.Volatile
If Not ChampActif(TitreChamp) Then FiltreCol = "": Exit Function
Set d = CreateObject("scripting.dictionary")
d.CompareMode = vbTextCompare
For Each c In Champ
If Not c.EntireRow.Hidden And c.Value <> "" Then d(c.Value) = c.Value
Next c
a = d.items
If IsDate(Champ(1)) Then
If d.Count = 1 Then
FiltreCol = TitreChamp & ":" & Format(a(0), "dd/mm/yyyy")
Else
mini = a(0): maxi = a(0)
For i = LBound(a) To UBound(a)
If a(i) < mini Then mini = a(i)
If a(i) > maxi Then maxi = a(i)
Next i
FiltreCol = TitreChamp & ":" & "> " & mini & " et < " & maxi
End If
Else
If IsNumeric(Champ(1)) Then
If d.Count = 1 Then
FiltreCol = TitreChamp & ":" & a(0): Exit Function
Else
mini = a(0): maxi = a(0)
For i = LBound(a) To UBound(a)
If a(i) < mini Then mini = a(i)
If a(i) > maxi Then maxi = a(i)
Next i
FiltreCol = TitreChamp & ":" & "> " & mini & " et < " & maxi: Exit Function
End If
Else
FiltreCol = TitreChamp & ": " & Join(a, ",")
' FiltreCol = Join(a, " ")
End If
End If
End Function