+ Reply to Thread
Results 1 to 4 of 4

Delete duplicates as per column E, Sum up values on col F, G... (please help)

  1. #1
    Forum Contributor
    Join Date
    01-29-2011
    Location
    Bristol, England
    MS-Off Ver
    Excel 2003
    Posts
    471

    Unhappy Delete duplicates as per column E, Sum up values on col F, G... (please help)

    Hi all
    I'm bit in a pickle. I'm supposed to to do presentation on Thursday and I have now realised one of my macro is wrong. I have taken a macro from another project and adjusted it to my need. I thought I had it right and only now realised it gets it wrong. On other project the values were numeric numbers and the code was working fine. On this occasion I need it to have a look of some part nubmers which also contain letters (i .e. its a string of text.) . Like this for example
    L57241218200
    L57256748200
    KNA12A3K20202C01


    Anyway this is what the code needs to do. It needs to look in column E (col 5). If there is a duplicate value it needs to remove all rows except the bottom one. Now at same time it needs to sum up values in column F, G, H and I.

    KNA12A3K21018C03 --------- 1 --------- 1 --------- 0 --------- 1
    KNA12A3K21018C03 --------- 3 --------- 3 --------- 0 --------- 1
    KNA12A3K21018C03 --------- 3 --------- 3 --------- 0 --------- 1
    KNA12A3K21018C03 --------- 6 --------- 3 --------- 0 --------- 1
    KNA12A3K21018C03 --------- 3 --------- 3 --------- 0 --------- 1
    KNA12A3K21018C03 --------- 10 --------- 7 --------- 0 --------- 1
    ----------------------------------------------------------------------------------------------------------------------------------
    So it would keep the last row of these duplicates and sum up like this
    KNA12A3K21018C03 --------- 26 --------- 20 --------- 0 --------- 6

    Current code is following. But feel free to do new one from scratch or do it anyway as you would know as this is bit messy with unwanted stuff there as well.
    Please Login or Register  to view this content.
    I have attached spreadsheet with current code. It has sheet "After" to give you an idea how it should look like (there might be mistakes on it on "after" sheet as I did it manually.).

    Im bit desperate as I have a presentation on Thursaday where I would need a this macro as its part of my other macros. Im almost 100% done with my stuff and now Im suddenly in trouble. Help would be most appreciated.
    Cheers
    Rain
    Attached Files Attached Files
    Last edited by rain4u; 07-05-2011 at 05:36 PM.

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Delete duplicates as per column E, Sum up values on col F, G... (please help)

    Maybe this, though not completely sure about your output:
    Please Login or Register  to view this content.

  3. #3
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Delete duplicates as per column E, Sum up values on col F, G... (please help)

    Try this:-
    Please Login or Register  to view this content.
    Regards Mick

  4. #4
    Forum Contributor
    Join Date
    01-29-2011
    Location
    Bristol, England
    MS-Off Ver
    Excel 2003
    Posts
    471

    Re: Delete duplicates as per column E, Sum up values on col F, G... (please help)

    Thank you both very much. I decided to go with your code MickG. It works like a charm. Thanks to you I can have some dynamic charts that will look something like this
    http://imageshack.us/photo/my-images/837/thankyouq.jpg/




    Now I wont embarrass myself at the meeting. Totally saved by you.
    Cheers
    Rain

+ 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