+ Reply to Thread
Results 1 to 10 of 10

Help! Macro: Combine rows with 'same name entry'

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

    Help! Macro: Combine rows with 'same name entry'

    Hello Excel experts!

    Please your my only hope I'm trying to create a macro that will consolidate rows with the 'same name' in Column 'B' within the entire table.

    So that if 'John Dear' has two or three, or four entries on my table they will be combined into one entry. Consider that names will be added to this table on an on-going basis so it would need to be applied to the entirety of the affected columns below.

    Column 'A' = Rank (NOT AFFECTED Please)

    Column 'B' = Employee (String) Yes
    Column 'C' = Total Sales (Currency) Yes
    Column 'D' = Transaction (Integer) Yes

    Column 'E' = Total Sales/Transaction (Currency) NOT AFFECTED because this column will automatically divide column 'C' by 'D'

    For the macro I would need it designed so that it combines the entries only if the names are completely identical (first and last name).

    Attached is my example spreadsheet. I would greatly appreciate any help with this as I just don't have the skills to write this myself. Thank you.
    Attached Files Attached Files
    Last edited by cjhiggins; 08-25-2013 at 03:49 PM.

  2. #2
    Registered User
    Join Date
    04-22-2012
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Help! Macro: Combine rows with 'same name entry'

    Can you not use a Pivot Table?

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

    Re: Help! Macro: Combine rows with 'same name entry'

    No unfortunately that would require me to retool my entire workbook that I'm using now. Which would probably be a disaster for me...

  4. #4
    Registered User
    Join Date
    04-22-2012
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Help! Macro: Combine rows with 'same name entry'

    Can you provide a sample of how you want it to look as well as the raw data you have already posted.

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Help! Macro: Combine rows with 'same name entry'

    Hi,

    Does the attached with a Pivot Table help?
    Attached Files Attached Files
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

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

    Re: Help! Macro: Combine rows with 'same name entry'

    I have added the spreadsheet with an example of how I would like it to look after the macro has been applied.
    Attached Files Attached Files

  7. #7
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Help! Macro: Combine rows with 'same name entry'

    Hi,

    Since there's a one to one mapping why not just link the cells in your layout to the PT layout. PTs are much easier to construct for this sort of analysis and usually a PT is sufficient in its own right. If you want a pretty layout to meet some sort of business standard then use the PT as the basis and work from there. You can usually avoid the need for macros.

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Help! Macro: Combine rows with 'same name entry'

    See if the attached will give you what you want. It uses a helper column (which you can hide), instead of a macro
    Attached Files Attached Files
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

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

    Re: Help! Macro: Combine rows with 'same name entry'

    Unfortunately this doesn't help me.

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Help! Macro: Combine rows with 'same name entry'

    please expand on your answer...why doesnt it work for you?

+ 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] Help with macro to combine rows
    By theatergirl in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-09-2013, 05:02 PM
  2. [SOLVED] Macro to combine rows
    By theatergirl in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-09-2013, 10:16 AM
  3. [SOLVED] Help with a macro to combine rows in a spreadsheet
    By theatergirl in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 03-21-2013, 10:17 AM
  4. Macro to combine Rows
    By floridagunner in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-12-2008, 07:29 PM
  5. Macro to combine variable rows
    By Help? in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-03-2006, 01:10 PM

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