Autofilter - Supply Criteria

J

JMay

I have an auto-filter table in Range A1:F8 (with Row1=header)

My Column E is 2-Character State (TX, NC) (Range E2:E8)

Can I enter into Cell K2 a Value say, NC which will
Instantly Filter my Range with only my NC records?
If so, how could this be done?

TIA,
 
J

John Bundy

It would jump around a lot because it would have to check that cell
everytime anything moved or changed, a button would be better but by the
time you did that you could just use the built in Custom functionality.
 
J

John Bundy

This will do what you want but remember K2 can be filtered out

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
myCell = Cells(2, 11)
If myCell <> "" Then
Selection.AutoFilter Field:=2, Criteria1:=myCell
End If
End Sub
 
Top