Private Sub Worksheet_Calculate()
Dim i As Byte
'Hervé
With ActiveSheet.AutoFilter
For i = 1 To .Filters.Count
[COLOR="Red"][B]Columns(i)[/B][/COLOR].Interior.ColorIndex = xlNone
If .Filters(i).On = True Then
[B][COLOR="Red"]Columns(i)[/COLOR][/B].Interior.ColorIndex = i + 34
End If
Next i
End With
End Sub
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
Never mind, je testerai ça au bureau, j'ai la version 2006...re
je ne sais pas pourquoi cela se décale et je ne peux pas tester car je n'ai pas excel 2002.
Private Sub Worksheet_Calculate()
Dim i As Byte
'Hervé
On Error Resume Next
With ActiveSheet.AutoFilter
For i = 1 To .Filters.Count
' seulement pour l'entête
'Cells(1, i).Interior.ColorIndex = xlNone
' Cells(1, i).Select
Range(Cells(1, i), Cells(1, i).End(xlDown)).Interior.ColorIndex = xlNone
If .Filters(i).On = True Then
' seulement pour l'entête
'Cells(1, i).Interior.ColorIndex = i + 34
' Cells(1, i).Select
Range(Cells(1, i), Cells(1, i).End(xlDown)).Interior.ColorIndex = i + 34
End If
Next i
End With
End Sub
Bonjour pro-bleme, bruno
le décalage provient des .select
tu peux modifier comme ceci :