"filter by cell value" shortcut

I am looking for a way to set a keyboard shortcut for a task I repeat dozens of times every day: filtering a spreadsheet by cell value. I know I can right click any cell and then select Filter -> By cell value from the context menu, but am looking for a snappier alternative.
I have looked everywhere with no joy. I even tried macros but my skills are not up to this apparently simple task...
|
Answer
Answer
Nope, you're doing nothing wrong - I overlooked the Field argument . Here's a better implementation:

    Public Sub FilterOnCellValue()
        Dim nField As Long
        With ActiveCell
            nField = .Column - .CurrentRegion.Cells(1).Column + 1
            .CurrentRegion.AutoFilter Field:=nField, Criteria1:=.Value
        End With
    End Sub

Thanks for the correction!!

7 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated March 18, 2021 Views 3,043 Applies to: