How to highlight column or column header if it is filtered in Excel?
For a table with multiple columns, it is not easy to find out which column is filtered at a glance as there is no obvious symbol for the filtered column except for a mark. If you want to make the filtered column outstanding in a table, a method in this article can help you.
Highlight column header or entire column if it is filtered with VBA code
Highlight column header or entire column if it is filtered with VBA code
As below screenshot shown, you need to highlight the entire column or only the column header if this column is filtered in a table range, please apply the following VBA codes.
1. Press the Alt + F11 keys to open the Microsoft Visual Basic for Applications window.
2. In the Microsoft Visual Basic for Applications window, please click Insert > Module. Then copy the below VBA code into the Module window.
VBA code: Highlight column header if the column is filtered
Sub HighLightTitle()
'Updated by Extendoffice 2017/9/12
Dim xRg As Range
Dim I As Integer
Dim xCount As Long
Dim xRgCol As Long
Dim xAddress As String
Dim xFilterCount As Long
On Error Resume Next
xAddress = ActiveWindow.RangeSelection.Address
Set xRg = Application.InputBox("Please select the first cell of the table range:", "KuTools For Excel", xAddress, , , , , 8)
If xRg Is Nothing Then Exit Sub
xRg.Select
With xRg(1).Parent.AutoFilter
xFilterCount = .Range.Columns.Count
xRgCol = xRg.Offset(1).Column - .Range.Column + 1
For I = xRgCol To xFilterCount
xCount = xRg.Offset(, I - xRgCol).Column - .Range.Column + 1
With .Filters(xCount)
If .On Then
xRg.Offset(, I - xRgCol).Interior.Color = 16736553
End If
End With
Next
End With
End Sub
For highlighting entire column if it is filtered in a table, please copy and paste the below VBA code into the Module window.
VBA code: Highlight entire column if it is filtered
Sub HighLightCols()
'Updated by Extendoffice 2017/9/12
Dim xRg As Range
Dim xCount As Long
Dim xRgCol As Long
Dim xAddress As String
Dim xRgFilter As Range
Dim xFilterCount As Long
On Error Resume Next
xAddress = ActiveWindow.RangeSelection.Address
Set xRg = Application.InputBox("Please select the first cell of the table range:", "KuTools For Excel", xAddress, , , , , 8)
If xRg Is Nothing Then Exit Sub
xRg.Select
With xRg(1).Parent.AutoFilter
xFilterCount = .Range.Columns.Count
xRgCol = xRg(1).Column - .Range.Column + 1
For I = xRgCol To xFilterCount
xCount = xRg.Offset(, I - xRgCol).Column - .Range.Column + 1
With .Filters(xCount)
Set xRgFilter = xRg.Offset(, I - xRgCol).Parent.AutoFilter.Range.Columns(xCount)
If .On Then
xRgFilter.Interior.Color = 16736553
End If
End With
Next
End With
End Sub
3. Press the F5 key to run the code. In the popping up Kutools for Excel dialog box, please select the first cell of the table you need to highlight the filtered column header or entire filtered column, and then click the OK button.
Then the column header or entire column will be highlighted immediately if the column is filtered in a certain table. See screenshots:
Highlight column header if the column is filtered in the table:
Highlight entire column if it is filtered in the table:
The Best Office Productivity Tools
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
- Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
- Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
- Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
- Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
- Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
- Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
- Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
- Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
- More than 300 powerful features. Supports Office / Excel 2007-2021 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial. 60-day money back guarantee.

Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!





