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
Bookmarks