FryGirl
Well-known Member
- Joined
- Nov 11, 2008
- Messages
- 1,368
- Office Version
- 365
- 2016
- Platform
- Windows
I found this thread to set a background color to the column header of the column with an autofilter applied.
It works fine on the Worksheet Activate event, but not for the Worksheet Change, Calculate, or Selection Change.
Not sure which on I need, but I'm just looking to apply the background color when the user applies a filter in row 1!
It works fine on the Worksheet Activate event, but not for the Worksheet Change, Calculate, or Selection Change.
Not sure which on I need, but I'm just looking to apply the background color when the user applies a filter in row 1!
Code:
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]Sub filterhighlight()
Dim flt As Filter
Dim intCol As Integer
For Each flt In ActiveSheet.AutoFilter.Filters
intCol = intCol + 1
If flt.On Then
Cells(1, intCol).Interior.ColorIndex = 6
Else
Cells(1, intCol).Interior.ColorIndex = xlColorIndexNone
End If
Next flt
End Sub
[/FONT]