Autofilter - Supply Criteria

  • Thread starter Thread starter JMay
  • Start date Start date
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,
 
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.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top