ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   filtering (https://www.excelbanter.com/excel-discussion-misc-queries/175485-filtering.html)

CMD

filtering
 
Hi. I use AutoFilter a lot to filter based on what information is contained
in a column. Is it possible to filter based on rows as well? For example,
show only columns that have this value in this row. Thanks.

Chris

Bernie Deitrick

filtering
 
Chris,

There is no built-in functionality to do that. You could use a macro, if you are comfortable with
that - for example, if you only wanted to show columns B to H if their value on the activecell's row
is Show Me, then you could use

Sub TryNow()
Dim myC As Range
For Each myC In Intersect(ActiveCell.EntireRow.Cells, Range("B:H"))
If myC.Value = "Show Me" Then
myC.EntireColumn.Hidden = False
Else
myC.EntireColumn.Hidden = True
End If
Next myC
End Sub


HTH,
Bernie
MS Excel MVP


"CMD" wrote in message
...
Hi. I use AutoFilter a lot to filter based on what information is contained
in a column. Is it possible to filter based on rows as well? For example,
show only columns that have this value in this row. Thanks.

Chris




Roger Govier[_3_]

filtering
 
Hi Chris

Debra Dalgleish has a downloadable example at
http://www.contextures.com/AdvFilterStateNum.zip

--
Regards
Roger Govier

"CMD" wrote in message
...
Hi. I use AutoFilter a lot to filter based on what information is
contained
in a column. Is it possible to filter based on rows as well? For
example,
show only columns that have this value in this row. Thanks.

Chris




All times are GMT +1. The time now is 03:38 PM.

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