Filter By Rows, Instead of Columns

Guzzlr

Well-known Member
Joined
Apr 20, 2009
Messages
946
Office Version
  1. 2016
Platform
  1. Windows
Hello All,
I often use colored cells to filter by column. For example, column A may have 30 cells colored blue, then i can easily filter by that color to get those particular cells in Column A.
But wonder if I want to do the same filter technique with colored cells, only by Row, instead of by Column.
For example, if Row 2 has some cells colored, then how can i set a filter on Row 2, to just filter for those individual colored cells?
Thanks for the help
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
There is no built-in feature in Excel to filter by rows so you need a macro. This macro assumes that row 2 contains data as well a color fill.
VBA Code:
Sub filterColors()
    Application.ScreenUpdating = False
    Dim lCol As Long, x As Long
    lCol = Cells(2, Columns.Count).End(xlToLeft).Column
    For x = lCol To 1 Step -1
        If Cells(2, x).Interior.ColorIndex = xlNone Then
            Columns(x).Hidden = True
        End If
    Next x
    Application.ScreenUpdating = True
End Sub
 
Upvote 0
You cannot currehtly set an Excel filter to filter on rows based on column content. The current capability is to filter on Columns, based on row content.
 
Upvote 0

Forum statistics

Threads
1,214,826
Messages
6,121,794
Members
449,048
Latest member
greyangel23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top