+ Reply to Thread
Results 1 to 6 of 6

Combine multiple rows with a certain criteria into one row

  1. #1
    Registered User
    Join Date
    06-24-2015
    Location
    Chicago
    MS-Off Ver
    2007 Excel
    Posts
    14

    Question Combine multiple rows with a certain criteria into one row

    Hello,

    I am working on a project where I need to combine multiple rows based on an ID number into one row. I have been trying to achieve this with a for each loop to match IDs from the previous cell in the loop range and cutting the entire row to the next empty column in the row above it. The worksheet looks something like this:

    Name ID# Acct # Acct Type
    Mike 1234 2345 1
    Bob 1235 3456 1
    Tom 1236 5678 1
    Tom 1236 5678 2
    Tom 1236 5678 3

    It should look like this:

    Name ID# Acct # Acct Type
    Mike 1234 2345 1
    Bob 1235 3456 1
    Tom 1236 5678 1 Tom 1236 5678 2 Tom 1236 5678 3

    I also need to delete the rows once the data is moved up. It's been difficult because the amount of ID number rows vary for each person. What would be the best way to achieve this. I am fairly new to VBA so any help would be greatly appreciated.

  2. #2
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    861

    Re: Combine multiple rows with a certain criteria into one row

    Hello,
    Can you upload a sample file?
    .. and don't forget to have fun!
    Bogdan.

    mark SOLVED and Add Reputation if my answer pleases you

  3. #3
    Registered User
    Join Date
    06-24-2015
    Location
    Chicago
    MS-Off Ver
    2007 Excel
    Posts
    14

    Re: Combine multiple rows with a certain criteria into one row

    Sample.xlsx

    Here is a sample. Need to move rows with same identifier onto one row in the first blank column in the row. For example, the 3 rows after the first Tom need to be moved to the row of the first Tom but in the next blank column in the row and then delete those 3 rows that have been moved.

    End result should look like this:

    EndResult.xlsx

    Thank You
    Last edited by mhf89; 07-16-2015 at 08:23 AM.

  4. #4
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    861

    Re: Combine multiple rows with a certain criteria into one row

    one way of doing it is:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-24-2015
    Location
    Chicago
    MS-Off Ver
    2007 Excel
    Posts
    14

    Re: Combine multiple rows with a certain criteria into one row

    Thank you so much! It worked great!

  6. #6
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    861

    Re: Combine multiple rows with a certain criteria into one row

    mark SOLVED and Add Reputation if my answer pleases 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. Combine multiple rows into one row
    By shani20 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-02-2015, 06:30 PM
  2. Replies: 6
    Last Post: 02-19-2014, 10:25 AM
  3. Replies: 1
    Last Post: 08-05-2013, 01:52 PM
  4. Replies: 2
    Last Post: 06-09-2013, 08:50 PM
  5. Combine multiple rows to one row
    By sojo0801 in forum Excel General
    Replies: 5
    Last Post: 01-19-2012, 01:10 PM
  6. Replies: 2
    Last Post: 12-03-2011, 03:51 AM
  7. Combine muliple rows into one based on criteria
    By smb2004 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-08-2007, 10:38 PM

Tags for this Thread

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