Filter on Active Cell

haftl31

New Member
Joined
Sep 20, 2005
Messages
12
Is there a way to quickly filter on the active cell?

For example, if I have a list of names that has been autofiltered. Is there a shortcut key that will show me only those cells that contain the name in the active cell without having to go up to the filter and scroll down to find the relevant name?

thanks
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Hi Haftl31,

Here's an example of how to do this. Let's say the autofilter is in cell D1 for column D, and the cell that you want to control the autofilter is B1. The following code added to the worksheet's code module will automatically perform the autofiltering when a filter value is entered in B1:

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
   If Target.Address = "$B$1" Then
      [D1].AutoFilter Field:=1, Criteria1:=[B1].Text
   End If
End Sub

To place this code in the worksheet's code module, right-click on the worksheet's tab, select View Code, and paste this code into the Code pane.

Keep Excelling.

Damon
 
Upvote 0
Hi
You can customise your toolbar so that it contains the button for autofilter. It looks like a filter paper with an equal sign next to it. It filters based on the currently selected entry.

Wolfshead
 
Upvote 0
Thank you both. Wolfshead, that's exactly what I was looking for. Do you know if there is a keyboard shortcut for that button. If not, I can record a macro and assign one.

Thanks again. Very helpful.
 
Upvote 0

Forum statistics

Threads
1,214,657
Messages
6,120,773
Members
448,991
Latest member
Hanakoro

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