ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Filtering Automatically (https://www.excelbanter.com/excel-programming/420402-filtering-automatically.html)

Choose Top 3 Automatically

Filtering 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.

Per Jessen[_2_]

Filtering Automatically
 
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

On 22 Nov., 16:36, Choose Top 3 Automatically <Choose Top 3
wrote:
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.




All times are GMT +1. The time now is 02:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com