+ Reply to Thread
Results 1 to 8 of 8

Consolidate rows into new list

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    06-28-2004
    MS-Off Ver
    Home/Office 2016
    Posts
    259

    Consolidate rows into new list

    I have a list showing 1st place, 2nd, etc and the number of times the horse/rider team placed in each event.
    Ex:
    1 joe mr.ed 4 5 (placed 1st 4 times in first event, 5 times in second)
    1 jim happy 1 3
    2 joe mr.ed 2 6 (placed 2nd 2 times in first, 6 times in second)

    Need output to show
    joe mr.ed 4 5 2 6
    jim happy 1 3

    {see attached}
    Attached Files Attached Files
    Last edited by x65140; 12-16-2014 at 05:30 PM.

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Consolidate rows into new list

    Have you look into pviot table?
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    06-28-2004
    MS-Off Ver
    Home/Office 2016
    Posts
    259

    Re: Consolidate rows into new list

    Have not entered into 'pivot mode' yet....would rather have VBA

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Consolidate rows into new list

    Maybe:

    Sub x65140()
    Dim i As Long
    Dim y As Long
    Dim x As Long
    
    For i = 7 To Range("B" & Rows.Count).End(3).Row
    x = Cells(i, 1).End(xlToRight).Column + 1
        For y = i + 1 To Range("B" & Rows.Count).End(3).Row
            If Cells(y, 2) = Cells(i, 2) And Cells(y, 3) = Cells(i, 3) Then
                Range(Cells(y, 4), Cells(y, 5)).Copy Cells(i, x)
                Rows(y).ClearContents
            End If
        Next y
    Next i
    
    End Sub

  5. #5
    Forum Contributor
    Join Date
    06-28-2004
    MS-Off Ver
    Home/Office 2016
    Posts
    259

    Re: Consolidate rows into new list

    I could work with that....but what if I should need to go to THIRD PLACE? How would I adjust your code for that?
    i.e. 1st, 2nd AND 3rd places....

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Consolidate rows into new list

    Maybe?

    Sub x65140()
    Dim i As Long
    Dim y As Long
    Dim x As Long
    For i = 8 To Range("B" & Rows.Count).End(3).Row
    x = Cells(i, 1).End(xlToRight).Column + 1
        For y = i + 1 To Range("B" & Rows.Count).End(3).Row
            If Cells(y, 2) = Cells(i, 2) And Cells(y, 3) = Cells(i, 3) Then
                Range(Cells(y, 4), Cells(y, 5)).Copy Cells(i, x)
                x = x + 2
                Rows(y).ClearContents
            End If
        Next y
    Next i
    
    End Sub

  7. #7
    Forum Contributor
    Join Date
    06-28-2004
    MS-Off Ver
    Home/Office 2016
    Posts
    259

    Re: Consolidate rows into new list

    Awesome! Appreciate the assistance!

  8. #8
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Consolidate rows into new list

    You're welcome. Glad to help out and thanks for the feedback.

+ 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. Replies: 1
    Last Post: 11-11-2013, 04:27 PM
  2. Replies: 2
    Last Post: 05-08-2012, 07:17 PM
  3. How to consolidate/sum a list
    By Larry Wallis in forum Excel General
    Replies: 5
    Last Post: 02-11-2005, 04:06 AM
  4. How to consolidate/sum a list
    By Larry Wallis in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-11-2005, 03:06 AM
  5. [SOLVED] How to consolidate/sum a list
    By Larry Wallis in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-11-2005, 03:06 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