parscon
03-10-2012, 02:38 PM
I have a Problem .
I have this code , this code will compare 3 column A-B-C and if find a duplicated in row will be deleted , but whe in have word+number it will not work . how can i fix it ?
Sub Delete()
Dim i As Long
Dim dCol As Long
Dim lrow As Long
'Column to check first (A)
dCol = 1
'Get last row of data, Col A
lrow = Cells(65536, dCol).End(xlUp).Row
'Check each row: lastrow to row 2
For i = lrow To 2 Step -1
'If Col A AND Col B and Col C are match
If Cells(i, 1) = Cells(i - 1, 1) And Cells(i, 2) And Cells(i, 3) = Cells(i - 1, 3) Then
'Delete dupe row
Cells(i, 1).EntireRow.Delete
End If
Next i
End Sub
I have this code , this code will compare 3 column A-B-C and if find a duplicated in row will be deleted , but whe in have word+number it will not work . how can i fix it ?
Sub Delete()
Dim i As Long
Dim dCol As Long
Dim lrow As Long
'Column to check first (A)
dCol = 1
'Get last row of data, Col A
lrow = Cells(65536, dCol).End(xlUp).Row
'Check each row: lastrow to row 2
For i = lrow To 2 Step -1
'If Col A AND Col B and Col C are match
If Cells(i, 1) = Cells(i - 1, 1) And Cells(i, 2) And Cells(i, 3) = Cells(i - 1, 3) Then
'Delete dupe row
Cells(i, 1).EntireRow.Delete
End If
Next i
End Sub