Comparing cells and in multiple columns
Solved/Closed
Reza
-
Feb 1, 2010 at 10:40 AM
rizvisa1 Posts 4479 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Feb 1, 2010 at 10:55 AM
rizvisa1 Posts 4479 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Feb 1, 2010 at 10:55 AM
Related:
- Comparing cells and in multiple columns
- Allow multiple downloads chrome - Guide
- Excel data validation list from table multiple columns - Guide
- Which key is used to make multiple line in a single cell - Guide
- How to delete multiple files on mac - Guide
1 reply
rizvisa1
Posts
4479
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
767
Feb 1, 2010 at 10:55 AM
Feb 1, 2010 at 10:55 AM
It will delete duplicate row (when item and price is same) and will delete the lower prices
If ActiveSheet.AutoFilterMode Then
Cells.Select
Selection.AutoFilter
End If
Cells.Select
Selection.Sort _
Key1:=Range("a2"), Order1:=xlAscending, _
Key2:=Range("b2"), Order2:=xlDescending, _
Header:=xlYes, OrderCustom:=1, _
MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal, _
DataOption2:=xlSortNormal
lrow = 2
Do While (Cells(lrow, 1) <> "")
If Cells(lrow, 1) = Cells(lrow + 1, 1) Then
Rows(lrow + 1).Delete
Else
lrow = lrow + 1
End If
Loop
If ActiveSheet.AutoFilterMode Then
Cells.Select
Selection.AutoFilter
End If
Cells.Select
Selection.Sort _
Key1:=Range("a2"), Order1:=xlAscending, _
Key2:=Range("b2"), Order2:=xlDescending, _
Header:=xlYes, OrderCustom:=1, _
MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal, _
DataOption2:=xlSortNormal
lrow = 2
Do While (Cells(lrow, 1) <> "")
If Cells(lrow, 1) = Cells(lrow + 1, 1) Then
Rows(lrow + 1).Delete
Else
lrow = lrow + 1
End If
Loop