+ Reply to Thread
Results 1 to 4 of 4

Auto Fillter data and copy to other table

  1. #1

    Auto Fillter data and copy to other table

    I have a column, which i would like to filter and copy the filtered
    data to other sheet.
    The filter criteria should be the items in the same column.
    Like using the auto filter.
    I know how to apply Auto filter - Selection.AutoFilter Field:=1,
    Criteria1:="xyz", but how to get this "xyz" from the values in that
    column?
    Should I loop throght the column cells, and somehow filter the items?
    I am lost?

    Also when looping throught column, how to stop if cell is empty?

    thanks


  2. #2
    Forum Contributor funkymonkUK's Avatar
    Join Date
    01-07-2005
    Location
    London, England
    Posts
    500

    I have the answer

    Range("A7").Select ' any cell on the top of your heading
    Selection.AutoFilter ' adds auto filter
    Selection.AutoFilter Field:=1, Criteria1:="xyz" ' selects the critiria i.e 1= first column. xyz=what you want to filter it by
    Selection.CurrentRegion.Select ' selects the results
    Selection.Copy ' copys the results
    Workbooks.Add ' adds workbook
    ActiveSheet.Paste ' pastes the results
    Application.CutCopyMode = False ' turns off the copy feature



    Hope that helps let me know if you have any questions

  3. #3

    Re: Auto Fillter data and copy to other table

    The problem is that i want to filter it by the contens of the column.

    let's say i have the following column
    xyz
    xyz
    xyz
    xyz
    zyx
    zyx
    zyx
    yxz
    yxz
    yxz


    i would like to filter and copy data for every single item - first for
    "xyz", second "zyx", third "yxz",

    don't know how to do it


  4. #4
    Forum Contributor funkymonkUK's Avatar
    Join Date
    01-07-2005
    Location
    London, England
    Posts
    500
    how many different values are there that you want to filter.

    it is not to long just copy the copy the amount of times and then you should be able to paste it in different workbooks or sheets.

    I think a "Do Loop" is in needed however I am not sure how to do a loop with autofilter.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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