+ Reply to Thread
Results 1 to 6 of 6

Thread: scan data, find max value of column, return single record on other worksheet

  1. #1
    Registered User
    Join Date
    01-26-2012
    Location
    Virginia
    MS-Off Ver
    Excel 2007
    Posts
    4

    scan data, find max value of column, return single record on other worksheet

    Hello,

    I tried searching but I didn't see anything. I'm trying to scan a range of data, locate the maximum date, and return only 1 unique account record on another worksheet tab. See attached. I would like a button I can click to do this.

    Thanks,
    VB
    Last edited by virtualnoob; 01-26-2012 at 07:13 PM. Reason: noob

  2. #2
    Valued Forum Contributor
    Join Date
    12-14-2009
    Location
    San Francisco, CA
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    986

    Re: scan data, find max value of column, return single record on other worksheet

    Please see attached for the solution
    To thank someone who has helped you, click on the star icon below their name.

    I hate reading

    Portfolio

    I need a job.
    I am young and incompetent

  3. #3
    Registered User
    Join Date
    01-26-2012
    Location
    Virginia
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: scan data, find max value of column, return single record on other worksheet

    Here's the file.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    01-26-2012
    Location
    Virginia
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: scan data, find max value of column, return single record on other worksheet

    if anyone can help and teach me how to do this, ill paypal you $

    edit: and sorry, the final output on the second tab should have B12 instead of the **** purchase
    Last edited by virtualnoob; 01-26-2012 at 08:21 PM.

  5. #5
    Valued Forum Contributor
    Join Date
    12-14-2009
    Location
    San Francisco, CA
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    986

    Re: scan data, find max value of column, return single record on other worksheet

    Now where is my money?

    Sub Test()
    Dim WS As Worksheet: Set WS = Worksheets("Original")
    Dim Col As Long, LR As Long
    Dim i As Long, j As Long
    
    With Application
    .ScreenUpdating = False
    .StatusBar = "Updating"
    End With
    
    With WS
        LR = .UsedRange.Rows.Count
        .Range(.Cells(1, 1), .Cells(LR, 3)).AdvancedFilter Action:=xlFilterCopy, _
            CopyToRange:=.Cells(1, 7), unique:=True
            For i = 2 To .Cells(Rows.Count, "I").Row
                For j = 2 To LR
                    If .Cells(i, "G") & .Cells(i, "H") & .Cells(i, "I") = .Cells(j, "A") & .Cells(j, "B") & .Cells(j, "C") Then
                        If .Cells(i, "J") < .Cells(j, "D") Then
                            .Cells(i, "J") = .Cells(j, "D")
                            .Cells(i, "K") = .Cells(j, "E")
                        End If
                    End If
                Next j
            Next i
    End With
    
    With Application
    .ScreenUpdating = True
    .StatusBar = ""
    End With
    
    End Sub
    To thank someone who has helped you, click on the star icon below their name.

    I hate reading

    Portfolio

    I need a job.
    I am young and incompetent

  6. #6
    Registered User
    Join Date
    01-26-2012
    Location
    Virginia
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: scan data, find max value of column, return single record on other worksheet

    Sweet. Thank you! Okay let me check it at work tomorrow - I'll let you know how it goes.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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.2.0