Filtering Automatically

  • Thread starter Thread starter Choose Top 3 Automatically
  • Start date Start date
C

Choose Top 3 Automatically

I am creating a model for a user. How do you choose(filter) the top 3 of 10
automatically after a user has changed input? I have been able to filter the
top 3 but when the users input changes, the filter does not automatically
update.
 
Hi

See if this code will help you.
Just notice as it's an event code it has to go into the code sheet for
desired sheet.

Private Sub Worksheet_Change(ByVal Target As Range)

Set isect = Intersect(Target, Range("A1:A100"))
If Not isect Is Nothing Then
Range("A1:A100").AutoFilter Field:=1, Criteria1:="3",
Operator:=xlTop10Items
End If
End Sub

Regards,
Per
 

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