ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How to change the color of the filter check box (https://www.excelbanter.com/excel-discussion-misc-queries/107341-how-change-color-filter-check-box.html)

Elena

How to change the color of the filter check box
 
I often use filtering functionality in Excel 2003. When I apply filtering by
one column to a data table, it is hard to find later, which column was used
for filtering since the filtering box of the selected column looks hardly
different from others (at least on my display).

I'd like to be able to use a bright fill color for the filtering check box.

Thanks!

Elena

Miguel Zapico

How to change the color of the filter check box
 
I don't know of a built-in way in Excel, but you can use VBA for simulating
it. For example, add this code to the worksheet selection_change event:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Set w = ActiveSheet
With w.AutoFilter.Filters
For i = 1 To .Count
If .Item(i).On Then
w.Cells(1, i).Interior.ColorIndex = 6
Else
w.Cells(1, i).Interior.ColorIndex = xlNone
End If
Next
End With
End Sub

To add it, right click on the worksheet tab, select View code on the
emergent menu, and paste the code above.
This may slow your worksheet, as it will make the comprobations each time
you move around in the worksheet, you can copy the contents (everthing
between sub and end sub) to a macro and run it on demand.

Hope this helps,
Miguel.

"Elena" wrote:

I often use filtering functionality in Excel 2003. When I apply filtering by
one column to a data table, it is hard to find later, which column was used
for filtering since the filtering box of the selected column looks hardly
different from others (at least on my display).

I'd like to be able to use a bright fill color for the filtering check box.

Thanks!

Elena


Elena

How to change the color of the filter check box
 
Thank you very much! This should do the trick.

I still would like to find out if/how to do this with Excel's own resources
in order to have it set up once and for all.

Thanks anyway, it was very kind of you to respond and maye I will use this
approach on some occassions.

Elena

"Miguel Zapico" wrote:

I don't know of a built-in way in Excel, but you can use VBA for simulating
it. For example, add this code to the worksheet selection_change event:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Set w = ActiveSheet
With w.AutoFilter.Filters
For i = 1 To .Count
If .Item(i).On Then
w.Cells(1, i).Interior.ColorIndex = 6
Else
w.Cells(1, i).Interior.ColorIndex = xlNone
End If
Next
End With
End Sub

To add it, right click on the worksheet tab, select View code on the
emergent menu, and paste the code above.
This may slow your worksheet, as it will make the comprobations each time
you move around in the worksheet, you can copy the contents (everthing
between sub and end sub) to a macro and run it on demand.

Hope this helps,
Miguel.

"Elena" wrote:

I often use filtering functionality in Excel 2003. When I apply filtering by
one column to a data table, it is hard to find later, which column was used
for filtering since the filtering box of the selected column looks hardly
different from others (at least on my display).

I'd like to be able to use a bright fill color for the filtering check box.

Thanks!

Elena



All times are GMT +1. The time now is 01:52 PM.

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