+ Reply to Thread
Results 1 to 4 of 4

Copy top 10 from a filtered table

  1. #1
    Registered User
    Join Date
    10-22-2013
    Location
    San Jose
    MS-Off Ver
    Excel 2010
    Posts
    2

    Copy top 10 from a filtered table

    Hey
    Wondering if you guys could help me out.

    I have a massive data dump, that I filter for XYZ intially in one colunm and then sort in another colunm. I want to copy the top 10 after both actions

    Windows("source.xlsx").Activate
    ActiveSheet.Range("$A$1:$BR$5114").AutoFilter Field:=20, Criteria1:="XYZ"
    ActiveWorkbook.Worksheets("ALL OPEN ").AutoFilter.Sort.SortFields.Clear
    ActiveWorkbook.Worksheets("ALL OPEN ").AutoFilter.Sort.SortFields.Add Key _:=Range("J1:J5114"), SortOn:=xlSortOnValues, Order:=xlDescending, _DataOption:=xlSortNormal

    End With

    Rows("1:10").Select "This is where I am getting stuck - I know I need to change 10 to something else."
    Selection.Copy

    The weekly data changes, so it is very possible that the top 10 will not be in the same row positions.

    Thanks

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Copy top 10 from a filtered table

    What determines where the "Top 10" are located? Is it a value in a column somewhere? Or do you literally need rows 1 through 10?

  3. #3
    Registered User
    Join Date
    10-22-2013
    Location
    San Jose
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Copy top 10 from a filtered table

    The top 10 after filtering and sorting might be rows ( the row #s vary every week)
    17
    20
    243
    3433
    3434
    5453
    ......

  4. #4
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Copy top 10 from a filtered table

    Let me see if I can explain better. How do you know what the top 10 are. Assume I know nothing, how would I know that 17, 20, 243, etc are the top 10.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Problem when copy filtered table in Excel 2007 using VBA
    By josel2820 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-24-2015, 01:19 PM
  2. Select and copy n number of rows from Filtered Table
    By Swindo in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-24-2013, 09:30 PM
  3. Copy a fixed range of cells from a filtered Table
    By jsuarez199 in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 06-27-2013, 06:53 AM
  4. Copy from filtered range to Table 1
    By jimrosser in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-28-2013, 07:08 PM
  5. How to copy cells to a filtered table?
    By joshuar in forum Excel - New Users/Basics
    Replies: 14
    Last Post: 07-08-2010, 06:05 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1