+ Reply to Thread
Results 1 to 2 of 2

Need help to show only the latest date

Hybrid View

  1. #1
    Registered User
    Join Date
    01-19-2015
    Location
    malaysia
    MS-Off Ver
    2010
    Posts
    1

    Need help to show only the latest date

    name colour date
    alex red 19/01/2015
    alex red 15/01/2015
    adam green 14/01/2015
    adam black 01/01/2015
    lucy gold 25/12/2015
    jenny red 01/12/2015
    jenny blue 01/01/2015
    jenny red 17/01/2015
    jenny red 17/01/2015

    The result should be show in another sheet as below, duplicate name & colour should be show once with the latest date :

    name colour date
    alex red 19/01/2015
    adam green 14/01/2015
    adam black 01/01/2015
    lucy gold 25/12/2015
    jenny blue 01/01/2015
    jenny red 17/01/2015

    Kindly help provide the code friends. Thanks.

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Need help to show only the latest date

    Sub GetLatestAlone()
    Dim rData As Range
    
    Set rData = Sheets("Sheet1").Range("A1").CurrentRegion
    
    Application.ScreenUpdating = False
    
    With Sheets("Sheet2")
        .Select
        .Range("A:C").ClearContents
        rData.Copy .Range("A1")
        Set rData = .Range("A1").CurrentRegion
        
        .Sort.SortFields.Add Key:=rData.Columns(1), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
        .Sort.SortFields.Add Key:=rData.Columns(2), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
        .Sort.SortFields.Add Key:=rData.Columns(3), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
        
        With .Sort
            .SetRange rData
            .Header = xlYes
            .MatchCase = False
            .Orientation = xlTopToBottom
            .SortMethod = xlPinYin
            .Apply
        End With
        
        Range("A1").CurrentRegion.RemoveDuplicates Array(1, 2), xlYes
    End With
    
    Application.ScreenUpdating = True
    
    End Sub


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

+ 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] Excel 2003: Show me the latest value (i think)
    By edmundo1971 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 02-21-2014, 12:42 PM
  2. Replies: 9
    Last Post: 11-28-2013, 05:20 PM
  3. Powerpivot - Returning latest update based on latest date
    By Kehjz in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 0
    Last Post: 08-22-2013, 02:45 PM
  4. show the latest date automaticly
    By JustinBourne in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-29-2007, 02:12 AM
  5. [SOLVED] show latest date input only
    By Nigel in forum Excel General
    Replies: 1
    Last Post: 12-01-2005, 08:00 AM

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