Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: top 10 auto filter

  1. #1
    New Member
    Join Date
    Apr 2002
    Posts
    38
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    i need a macro that will bring up the 'Top 10 auto filter' input box

  2. #2
    MrExcel MVP Jay Petrulis's Avatar
    Join Date
    Mar 2002
    Location
    Chicago, IL USA
    Posts
    2,040
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    The following line will sort on column M (13th field from A1) and bring up the top 10

    Range("A1").AutoFilter Field:=13, Criteria1:="10", Operator:=xlTop10Items


    Change the criteria to whatever you want, or have it as a variable (a cell value or an input box, for example).

    MyVar = InputBox("Enter top ## of items to display")

    Range("A1").AutoFilter Field:=13, Criteria1:=MyVar, Operator:=xlTop10Items

    HTH,
    Jay

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •