sjandavid16
New Member
- Joined
- Mar 5, 2020
- Messages
- 3
- Office Version
- 2010
- Platform
- Windows
Hi All,
I'm a beginner in terms of VBA and so I need help in finding duplicate data in columns then automatically deletes or selects them for deletion.
Here's a macro VBA code I found on the internet but it only displays the word "duplicate" in another column.
-
Sub sbFindDuplicatesInColumn()
Dim lastRow As Long
Dim matchFoundIndex As Long
Dim iCntr As Long
lastRow = Range("A65000").End(xlUp).Row
For iCntr = 1 To lastRow
If Cells(iCntr, 1) <> "" Then
matchFoundIndex = WorksheetFunction.Match(Cells(iCntr, 1), Range("A1:A" & lastRow), 0)
If iCntr <> matchFoundIndex Then
Cells(iCntr, 4) = "Duplicate"
End If
End If
Next
End Sub
-
Please help me, Thanks in advance!
FYI, I just want to delete the duplicate data in column A.
I'm a beginner in terms of VBA and so I need help in finding duplicate data in columns then automatically deletes or selects them for deletion.
Here's a macro VBA code I found on the internet but it only displays the word "duplicate" in another column.
-
Sub sbFindDuplicatesInColumn()
Dim lastRow As Long
Dim matchFoundIndex As Long
Dim iCntr As Long
lastRow = Range("A65000").End(xlUp).Row
For iCntr = 1 To lastRow
If Cells(iCntr, 1) <> "" Then
matchFoundIndex = WorksheetFunction.Match(Cells(iCntr, 1), Range("A1:A" & lastRow), 0)
If iCntr <> matchFoundIndex Then
Cells(iCntr, 4) = "Duplicate"
End If
End If
Next
End Sub
-
Please help me, Thanks in advance!
FYI, I just want to delete the duplicate data in column A.