Hi All
(dont know if this is first part is relative in this instance) Currently using the following to remove duplicate entries from a list leaving a row based on the latest date entry
Sub Deleteduplicates()
Dim RowNdx As Long
For RowNdx = Range("A1").End(xlDown).Row To 2 Step -1
If Cells(RowNdx, "A").Value = Cells(RowNdx - 1, "A").Value Then
If Cells(RowNdx, "B").Value <= Cells(RowNdx - 1, "B").Value Then
Rows(RowNdx).Delete
Else
Rows(RowNdx - 1).Delete
End If
End If
Next RowNdx
End Sub
is there a way though of it cycling through a list in column a which has already been sorted (so they are group) and based on the latest date (column b), inserting 1,2,3,4 or 5 or something that will signify an order(column c)
i.e the end result would look like this
acc date order
1 22/07/2011 2
1 21/07/2011 3
1 23/07/2011 1
2 23/07/2011 1
3 21/07/2011 4
3 22/07/2011 3
3 23/07/2011 2
3 24/07/2011 1
hope that makes sense
(dont know if this is first part is relative in this instance) Currently using the following to remove duplicate entries from a list leaving a row based on the latest date entry
Sub Deleteduplicates()
Dim RowNdx As Long
For RowNdx = Range("A1").End(xlDown).Row To 2 Step -1
If Cells(RowNdx, "A").Value = Cells(RowNdx - 1, "A").Value Then
If Cells(RowNdx, "B").Value <= Cells(RowNdx - 1, "B").Value Then
Rows(RowNdx).Delete
Else
Rows(RowNdx - 1).Delete
End If
End If
Next RowNdx
End Sub
is there a way though of it cycling through a list in column a which has already been sorted (so they are group) and based on the latest date (column b), inserting 1,2,3,4 or 5 or something that will signify an order(column c)
i.e the end result would look like this
acc date order
1 22/07/2011 2
1 21/07/2011 3
1 23/07/2011 1
2 23/07/2011 1
3 21/07/2011 4
3 22/07/2011 3
3 23/07/2011 2
3 24/07/2011 1
hope that makes sense