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

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
Try:

Code:
Sub Test()
    With Worksheets("Sheet B").Range("B:B")
        .AutoFilter
        .AutoFilter Field:=1, Criteria1:="=" & ActiveCell.Value, Operator:=xlAnd
    End With
End Sub
 

low98

Board Regular
Joined
Dec 21, 2004
Messages
116
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?
 

Forum statistics

Threads
1,136,308
Messages
5,674,990
Members
419,541
Latest member
freddyboots

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
Top