ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Changing the color of the data auto filter buttons (https://www.excelbanter.com/excel-worksheet-functions/202049-changing-color-data-auto-filter-buttons.html)

Jane P

Changing the color of the data auto filter buttons
 
Presently the active buttons are blue against a grey background and not very
visible. How can I change the active blue to a brighter color?

Héctor Miguel

Changing the color of the data auto filter buttons
 
hi, Jane !

Presently the active buttons are blue against a grey background and not very visible.
How can I change the active blue to a brighter color?


AFAIK the color of autofilter dropdown buttons can not be customized (it is by design)
you could use macros (i.e. in the '_calclate' event for "that" worksheet)
(if you don't mind to loose the stack for the undo levels)

hth,
hector.

right-click the tab-name of our worksheet and choose "view code"...
- copy/paste (or type) the following lines

Private Sub Worksheet_Calculate()
Dim cFilter As Integer
Application.ScreenUpdating = False
With Me
If Not .AutoFilterMode Then Exit Sub
With Range(.AutoFilter.Range.Address)
For cFilter = 1 To .Columns.Count
With .Cells(1, cFilter)
If .Parent.AutoFilter.Filters(cFilter).On Then
.Interior.ColorIndex = 6
.Font.ColorIndex = 3
Else
.Interior.ColorIndex = xlColorIndexNone
.Font.ColorIndex = xlColorIndexAutomatic
End If
End With
Next
End With
End With
End Sub

- *IF* there are NO formulae in your worksheet, the '_calculate' event could not be triggered
(a simple =now() function could it be enough)
or, create a sub procedure (in a standard code module) and use the above code with in
- change the reference to "the worksheet":
from: With Me
into: With ActiveSheet
you should run "the sub" whenever you need to update the colors




All times are GMT +1. The time now is 03:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com