+ Reply to Thread
Results 1 to 4 of 4

Autofilrer copying cells/column to another worksheet in VBA

  1. #1
    Forum Contributor
    Join Date
    07-17-2011
    Location
    PH
    MS-Off Ver
    Excel 2007
    Posts
    183

    Autofilrer copying cells/column to another worksheet in VBA

    Hi,

    I have a macro autofilter records the column M where it has a value of #N/A.
    after filtering the records i wanted to copy the cells/column to another worksheet as temporary
    then remove the duplicate records. after removing duplicate records i have to copy the final result to mastersheet, find the last empty row of column Y then dump the records.

    Here is my vba code and sample result.

    Please Login or Register  to view this content.
    sample data

    1. AutoFiltered records sample data

    ITEMTYPE | ITEM |WHSE | LOCATION | REMARKS
    ----------------------------------------------
    PART1------PARTS---IUS-----PH---------#N/A
    PART1------PARTS---IUS-----PH---------#N/A
    PART2------PARTS---IUS-----WS---------#N/A
    PART2------PARTS---IUS-----WS---------#N/A


    2. copy to another worksheet and remove duplicate records base on LOCATION

    RESULT
    ITEMTYPE | ITEM |WHSE | LOCATION
    ------------------------------------
    PART1------PARTS---IUS-----PH-------
    PART2------PARTS---IUS-----WS-------


    3. copy those removed duplicate to the master worksheet

    RESULT
    DATE | ITEM | WHSE | LOCATION
    -----------------------------------
    8-Aug ------PARTS---IUS-----PH-----
    8-Aug ------PARTS---IUS-----WS-----

  2. #2
    Forum Contributor
    Join Date
    07-17-2011
    Location
    PH
    MS-Off Ver
    Excel 2007
    Posts
    183

    Re: Autofilrer copying cells/column to another worksheet in VBA

    Here is my codes and so far it is working. my concern is i got an error in this portion of codes Rng.AutoFilter Field:=12, Criteria1:=Array("#N/A") .

    Error message : auto filter Method of range class failed

    May I ask assistance on how to solved this issue. thanks.

    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Autofilrer copying cells/column to another worksheet in VBA

    Your range is limited to column A while you are trying to filter column m

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    07-17-2011
    Location
    PH
    MS-Off Ver
    Excel 2007
    Posts
    183

    Re: Autofilrer copying cells/column to another worksheet in VBA

    Thank you very much. I did not notice. Its working now.

+ 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. Copying Column from separate tabs in same worksheet into another worksheet with each colum
    By campbellbyte in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-31-2014, 12:30 AM
  2. Copying cells dynamically to a worksheet based on values in another worksheet
    By freelance in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-10-2013, 01:45 PM
  3. Replies: 2
    Last Post: 12-13-2012, 01:10 AM
  4. [SOLVED] Copying selected cells from multiple rows and columns from worksheet to worksheet
    By janlindgren in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-25-2012, 02:58 AM
  5. Copying a worksheet witrh protected cells to a new worksheet
    By John in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-01-2006, 10:25 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