+ Reply to Thread
Results 1 to 3 of 3

find duplicates, and copy the first duplicate

  1. #1
    Registered User
    Join Date
    07-13-2010
    Location
    Middle, Africa
    MS-Off Ver
    Excel 2003
    Posts
    2

    Unhappy find duplicates, and copy the first duplicate

    So I recently made some tweaks to a macro that an employee had stashed on their computer prior to them leaving the office. I had it working a few times and now it errors out on me, and with a small background in java I understand just enough to be able to make things work. Now I'm stuck.

    The macro is supposed to use my entire spreadsheet, find duplicates, and copy the first duplicate (edit: and its entire row) to the second sheet. I use =COUNTIF(A4:A1836,"="&A4) to generate my H column with how many occurences a UPC code is entered in the list proceeding the current number, which means if 14 happens twice, the first 14 will have a 2 in the H column and the second 14 will have a 1.

    I've looked through the coding and as far as I can see, it must be some spacing or programming grammar that has caused it to error, any help would be greatly appreciated.

    Here is the macro


    Please Login or Register  to view this content.
    Last edited by rylo; 07-14-2010 at 05:59 PM. Reason: Thank you admins for changing my title! Really appreciate it!

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: find duplicates, and copy the first duplicate

    Hi

    Ran OK for me. How about adding an example file that causes the error for us to review.

    rylo

  3. #3
    Registered User
    Join Date
    07-13-2010
    Location
    Middle, Africa
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: find duplicates, and copy the first duplicate

    Looks like this is solved then, I've been using the same spreadsheet and I must have goofed something up, I can't get it to go past the first line. I opened up a new spreadsheet and put the macro to the same data and it works. Sorry for that, guess another human error fixed


    Edit: I did a complete copy paste and it works, there is something about the other spreadsheet that is causing errors, Thanks for such a quick reply Rylo, I appreciate it!
    Last edited by Caseyv; 07-14-2010 at 10:59 AM.

+ 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