+ Reply to Thread
Results 1 to 25 of 25

MACRO: Consolidate 'like' entries in table as one entry

  1. #1
    Registered User
    Join Date
    08-15-2013
    Location
    Mississauga, Canada
    MS-Off Ver
    Excel 2010
    Posts
    30

    MACRO: Consolidate 'like' entries in table as one entry

    Hello again Excel Experts...

    I need some serious help regarding this macro...

    1)It must be a macro, not pivot table, please don't suggest a pivot table.

    2) Here is the concept of the macro:

    It takes IDENTICAL (first and last name) entries that are entered in column 'B' and consolidates the data in columns 'C' and 'D' respectively.

    3) Columns 'B', 'C', and 'D' are the only columns being targeted in this macro.

    So...instead of having multiple entries under the same name with different data, it adds it together under a single entry being of the same name.

    I'm really stuck. Please see attached my example spreadsheet, with 'before the macro' is applied and 'after' it is applied.

    Please consider that while on my example sheet there are only 6 entries, the list could be considerably longer and would need to affect the entire sheet within the perimeters set above.

    This is a challenge. Please help. Thank you.
    Attached Files Attached Files
    Last edited by cjhiggins; 08-26-2013 at 04:50 AM.

  2. #2
    Registered User
    Join Date
    08-15-2013
    Location
    Mississauga, Canada
    MS-Off Ver
    Excel 2010
    Posts
    30

    Re: MACRO: Consolidate 'like' entries in table as one entry

    Ife anyone requires additional information or finds my post confusing please let me know and I'd be happy to clarify

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

    Re: MACRO: Consolidate 'like' entries in table as one entry

    Since you want to consolidate columns B and C only, the first match row would be appear in column E.
    The output is in new sheet.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    08-15-2013
    Location
    Mississauga, Canada
    MS-Off Ver
    Excel 2010
    Posts
    30

    Re: MACRO: Consolidate 'like' entries in table as one entry

    Sorry, but what does that mean?

    Update: I've taken a look at your output sheet and I don't see how this solves my issue.
    Last edited by cjhiggins; 08-26-2013 at 04:49 AM.

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

    Re: MACRO: Consolidate 'like' entries in table as one entry

    You should like at the output and see if the code works for you.

  6. #6
    Registered User
    Join Date
    08-15-2013
    Location
    Mississauga, Canada
    MS-Off Ver
    Excel 2010
    Posts
    30

    Re: MACRO: Consolidate 'like' entries in table as one entry

    I see what you've done, however I need the macro to work within the single spreadsheet, not create a new one. I'm sorry but this doesn't work for me but its close!

  7. #7
    Registered User
    Join Date
    08-15-2013
    Location
    Mississauga, Canada
    MS-Off Ver
    Excel 2010
    Posts
    30

    Re: MACRO: Consolidate 'like' entries in table as one entry

    Can anyone help me please?

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

    Re: MACRO: Consolidate 'like' entries in table as one entry

    The code works as long as you can cope with merged cells. Merged cells are nightmare in excel, so if you have merged cells, you will get a funny output.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    08-15-2013
    Location
    Mississauga, Canada
    MS-Off Ver
    Excel 2010
    Posts
    30

    Re: MACRO: Consolidate 'like' entries in table as one entry

    Thank you AB33 for sticking with me, this code is a lot better however can you write a code that doesn't effect column 'A' (which is the ranking numbers), and that consolidates the entries on the 'real table' and not the 'after macro example table' Because in reality there is no 'after macro table' its there as an example of how the real table should look when the macro is applied. Thank you!

    This isn't a movement from one table to another, its altering the one existing table.
    Last edited by cjhiggins; 08-26-2013 at 05:40 AM.

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

    Re: MACRO: Consolidate 'like' entries in table as one entry

    Unless you get rid of the merged cells, the code will not work.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    08-15-2013
    Location
    Mississauga, Canada
    MS-Off Ver
    Excel 2010
    Posts
    30

    Re: MACRO: Consolidate 'like' entries in table as one entry

    Which merged cells? None of the affected data contains merged cell. The title for the workbook is a merged cell, as well as the title of that particular table.

  12. #12
    Registered User
    Join Date
    08-15-2013
    Location
    Mississauga, Canada
    MS-Off Ver
    Excel 2010
    Posts
    30

    Re: MACRO: Consolidate 'like' entries in table as one entry

    UPDATE ON EXAMPLE SPREADSHEET BEFORE & AFTER.

    See attached.
    Attached Files Attached Files

  13. #13
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: MACRO: Consolidate 'like' entries in table as one entry

    This should do
    Please Login or Register  to view this content.

  14. #14
    Registered User
    Join Date
    08-15-2013
    Location
    Mississauga, Canada
    MS-Off Ver
    Excel 2010
    Posts
    30

    Re: MACRO: Consolidate 'like' entries in table as one entry

    Hey Jindon thanks a lot! However this code alters column 'E', I need that column to remain unaltered by the code.

  15. #15
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: MACRO: Consolidate 'like' entries in table as one entry

    You mean?
    Please Login or Register  to view this content.

  16. #16
    Registered User
    Join Date
    08-15-2013
    Location
    Mississauga, Canada
    MS-Off Ver
    Excel 2010
    Posts
    30

    Re: MACRO: Consolidate 'like' entries in table as one entry

    No. I mean so that when the data is consolidated it will still calculate the average/transaction which is what column 'E' does. Your code writes over that column.

    What is being consolidated is strictly column 'B' 'C' and 'D'. Not 'A or 'E'

  17. #17
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: MACRO: Consolidate 'like' entries in table as one entry

    Ahhh, OK

    Change
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

  18. #18
    Registered User
    Join Date
    08-15-2013
    Location
    Mississauga, Canada
    MS-Off Ver
    Excel 2010
    Posts
    30

    Re: MACRO: Consolidate 'like' entries in table as one entry

    THANK YOU THANK YOU THANK YOU !!! A week I've been contending with this code and you've done it in a half hour span! Thank you so much!

  19. #19
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: MACRO: Consolidate 'like' entries in table as one entry

    No problem.

    Please don't forget to mark this thread as "Solved".

  20. #20
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: MACRO: Consolidate 'like' entries in table as one entry

    Re your message.

    You don't want to get col.E to be changed?
    Please Login or Register  to view this content.

  21. #21
    Registered User
    Join Date
    08-15-2013
    Location
    Mississauga, Canada
    MS-Off Ver
    Excel 2010
    Posts
    30

    Re: MACRO: Consolidate 'like' entries in table as one entry

    Thank you so much Jindon I've confirmed this code on my master sheet and it works beautifully. Sorry about the confusion. I won't forget this. Thank you!
    Last edited by cjhiggins; 08-26-2013 at 06:03 PM.

  22. #22
    Registered User
    Join Date
    08-15-2013
    Location
    Mississauga, Canada
    MS-Off Ver
    Excel 2010
    Posts
    30

    Re: MACRO: Consolidate 'like' entries in table as one entry

    Jindon, just one more thing I promise I feel so bad for taking so much of your time.

    When you clear the contents of columns 'B thru D' it leaves column 'E' with this:

    #Div/0!

    But it should still say '0' because this code: =IF(D10=0,"0",C10/D10) [ignore that specific range] should remain unchanged even after the contents of B thru D are cleared.

    I bow to your skills!

  23. #23
    Registered User
    Join Date
    08-15-2013
    Location
    Mississauga, Canada
    MS-Off Ver
    Excel 2010
    Posts
    30

    Re: MACRO: Consolidate 'like' entries in table as one entry

    Attached is the example spreadsheet with your newest code.

    Consolidate the entries first. Your code is amazing.

    But then clear the contents for the entries B:D and see what it does to col.E
    Attached Files Attached Files
    Last edited by cjhiggins; 08-26-2013 at 06:19 PM.

  24. #24
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: MACRO: Consolidate 'like' entries in table as one entry

    OOps,

    Can you replace back to the original?
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    Attached Files Attached Files

  25. #25
    Registered User
    Join Date
    08-15-2013
    Location
    Mississauga, Canada
    MS-Off Ver
    Excel 2010
    Posts
    30

    Re: MACRO: Consolidate 'like' entries in table as one entry

    Thank you its complete. If your ever in Mississauga, Ontario, Canada send me a line. I owe you a drink!

+ 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. [SOLVED] Automatically consolidate table entries and reformat
    By Seraph122 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 03-22-2013, 02:26 AM
  2. Need formula to consolidate entries from several sheets
    By stan2013 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-04-2013, 07:33 PM
  3. [SOLVED] Macro to consolidate entries from days to weeks
    By Seraph122 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 01-09-2013, 05:41 PM
  4. Replies: 3
    Last Post: 01-12-2010, 06:49 AM
  5. How to consolidate multiple like entries?
    By dikteren in forum Excel General
    Replies: 2
    Last Post: 10-14-2009, 06:30 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