Hiding Rows based on cell value

low98

Board Regular
Joined
Dec 21, 2004
Messages
116
I'm trying to hide all rows on a sheet that are NOT equal to an active cell. Basically 'Sheet A' has a single cell that is currently active (A:A range), and I'd like to hide all rows that don't equal this active cell on 'Sheet B' (B:B range). Any pointers would be great!

Thanks!
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Try:

Code:
Sub Test()
    With Worksheets("Sheet B").Range("B:B")
        .AutoFilter
        .AutoFilter Field:=1, Criteria1:="=" & ActiveCell.Value, Operator:=xlAnd
    End With
End Sub
 
Upvote 0
Thanks for the suggestion, however it seems to make this workbook chug much longer then I was looking for. Is there another avenue that doesn't use AutoFilter perhaps?
 
Upvote 0

Forum statistics

Threads
1,214,923
Messages
6,122,289
Members
449,077
Latest member
Rkmenon

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