Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub smaz_duplicity()
- Columns("A:D").Select
- ActiveWorkbook.Worksheets("List1").Sort.SortFields.Clear
- ActiveWorkbook.Worksheets("List1").Sort.SortFields.Add Key:=Range("A:A"), _
- SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
- ActiveWorkbook.Worksheets("List1").Sort.SortFields.Add Key:=Range("B:B"), _
- SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
- With ActiveWorkbook.Worksheets("List1").Sort
- .SetRange Range("A:D")
- .Header = xlYes
- .MatchCase = False
- .Orientation = xlTopToBottom
- .SortMethod = xlPinYin
- .Apply
- End With
- Cells(1, 1).Select
- konec = Cells(Rows.Count, "A").End(xlUp).Row
- For i = konec To 2 Step -1
- If Cells(i, 1).Value = Cells(i - 1, 1).Value Then
- Rows(i).Delete
- End If
- Next i
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement