+ Reply to Thread
Results 1 to 7 of 7

Sort results on seperate sheet

  1. #1
    Forum Contributor
    Join Date
    03-16-2004
    MS-Off Ver
    2016
    Posts
    175

    Sort results on seperate sheet

    I have a result sheet where I want to extract the winner of races from sheet1 to sheet2. My result sheet is 50,000 lines long. See Sample for format.

    I want a macro to copy the line that is 2 spaces below the word "Name" that is repeated in Col A and is the separation between the races. Copy A:E there. Put that on sheet 2 Col A as shown in the sample. Then go back to sheet 1 and find the winner of the race which will be the one with a value in column B. Copy A:I there. Go to sheet2 and put that on the same line as the previous entry starting in Col F. Repeat Thanks.
    Attached Files Attached Files
    Last edited by light; 03-04-2023 at 10:29 PM.

  2. #2
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,964

    Re: Sort results on seperate sheet

    Please Login or Register  to view this content.
    OR
    Please Login or Register  to view this content.
    Last edited by Sintek; 03-04-2023 at 03:11 AM.
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  3. #3
    Forum Contributor
    Join Date
    03-16-2004
    MS-Off Ver
    2016
    Posts
    175

    Re: Sort results on seperate sheet

    Thank You very much sintek. There is a problem in that not all blocks of data have an "OP". When the code encounters that it produces an error. But they all are either a 2 or 3 letter designation.

  4. #4
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: Sort results on seperate sheet

    Hello light. Try with:

    PHP Code: 
    Sub Macro8()
    Dim aQ&, i&, bc(1 To 2), R&, j%
    With Sheets("Sheet1")
      
    = .Cells(Rows.Count1).End(xlUp).Row
      a 
    = .Range("a1:i" Q)
    End With
    ReDim b
    (1 To Q1 To 14)
    For 
    1 To Q
      Select 
    Case True
        
    Case a(i1) = "NAME"Erase cc(1) = i
        
    Case IsNumeric(a(i2)) And Not IsEmpty(a(i2))
          If 
    a(i2) > And Not IsEmpty(c(1)) Then
            c
    (2) = iR
            
    For 1 To 5b(Rj) = a(c(1), j): Next
            
    For 6 To 14b(Rj) = a(c(2), 5): Next
          End 
    If
      
    End Select
    Next
    With Sheets
    ("Sheet2")
      .
    UsedRange.Delete xlShiftUp: .Activate
      
    If 0 Then
        
    .Cells(1).Resize(R14) = b
        
    .Cells(1).Resize(R14).Columns(14).NumberFormat "0%"
        
    .Cells(1).Resize(R14).Columns.AutoFit
      End 
    If
    End With
    End Sub 
    You are always very welcome if you add reputation by clicking the * (bottom left) of each message that has helped you.

  5. #5
    Forum Contributor
    Join Date
    03-16-2004
    MS-Off Ver
    2016
    Posts
    175

    Re: Sort results on seperate sheet

    WOW, Thanks beyond Excel. That did the trick. Works great on the master sheet. Appreciate it.

  6. #6
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: Sort results on seperate sheet

    Quote Originally Posted by light View Post
    WOW, Thanks beyond Excel. That did the trick. Works great on the master sheet. Appreciate it.
    Thank you very much for your consideration and it will be until next time.

  7. #7
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,964

    Re: Sort results on seperate sheet

    Apologies...was away...Next time perhaps upload sample file representing actual file...Glad you got it sorted...

+ 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. Sort Query Results to remove duplicate entries and put results on one line.
    By Panther70 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-01-2015, 03:03 PM
  2. Replies: 4
    Last Post: 11-20-2012, 06:00 PM
  3. Unable to take results sheet and divided them into two seperate results
    By dannyboy1982 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-26-2012, 03:35 PM
  4. Inconsistent code results, saving sheet to seperate location
    By galvinpaddy in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-01-2012, 07:34 AM
  5. Filtering Results and Copying Each Result to a Seperate Sheet
    By gjaylward2008 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-16-2012, 04:10 PM
  6. Replies: 1
    Last Post: 06-20-2006, 09:20 PM
  7. Sort out data on seperate sheet
    By Linda in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 06-13-2006, 01:15 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