+ Reply to Thread
Results 1 to 5 of 5

Copy Specific Rows of Data Based On two Values

  1. #1
    Valued Forum Contributor
    Join Date
    11-15-2007
    Location
    England
    MS-Off Ver
    Office Pro 2003 / 2010
    Posts
    423

    Copy Specific Rows of Data Based On two Values

    Hi,

    I have a worksheet called Download with 55000 rows of data in it.

    In column H I have a 13 digit number.

    In column I have a Customer Name.

    I need to do two things.

    On the Dowload Sheet where the Customer Name In Column I is Customer 1 for example, I want to copy all those rows to a sheet called De Dupe.

    When the data is on the De Dupe Sheet I need to remove any Duplicated numbers in Column H so that I am left with a clean list for Customer 1 of unique numbers in column H.

    Could someone provide a macro that could do this please?

    Many thanks

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Copy Specific Rows of Data Based On two Values

    help us attaching a samplefile (not 55.000 rows)
    If solved remember to mark Thread as solved

  3. #3
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Copy Specific Rows of Data Based On two Values

    Hi, timbo1957,

    if itīs just customer you coud make good use of the Autofilter in Column I in Sheet "Download" and only copy the visible cells to Sheet "De Dupe". On the latter you could apply the Advanced Filter to show Uniques.

    Or use the Advanced Filter with Headings, a criteria range and output range on Sheet De Dupe and copy only those records.

    If you go by VBA I would apply either of the two methods as basic. Depending on the number of records you may as well use a loop for transporting data and checking the 13 digit number from the start of the area to the actual row (if WorksheetFunction.CountIf(Range/"I":I" & lngCounter, "Range("I" & lngCounter).Value) = 1 copy, else skip).

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  4. #4
    Valued Forum Contributor
    Join Date
    11-15-2007
    Location
    England
    MS-Off Ver
    Office Pro 2003 / 2010
    Posts
    423

    Re: Copy Specific Rows of Data Based On two Values

    Please find a cut down copy attached the Download is usually 55,000 rows long.

    I have tried Advanced Filter but I can't seem to get it to work.

    Perhaps someone could give some step by step instructions of a macro won't do it.
    Attached Files Attached Files

  5. #5
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Copy Specific Rows of Data Based On two Values

    Hi, timbo1957,

    have a look at the workbook. I added a new sheet (Criteria) as well as some code (the range for the criteria is limited to 1 row/creditor in these codes) and added Customer to the headings:
    Please Login or Register  to view this content.
    To me Customer1 and Customer 1 are not identical due to the bank.

    Ciao,
    Holger
    Attached Files Attached Files

+ 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