May 09 2021 02:26 AM - edited May 09 2021 02:32 AM
Hello Team,
How can I remove just a single cell duplicate without affecting whole rows for duplicate value? I have more than 160,000 rows, with a lot of those duplicates. Below is an example of what I need. I have also attached an excel file, I am using 365.
May 09 2021 02:36 AM
SolutionHere is a macro that you can run:
Sub ClearDuplicates()
Dim r As Long
Dim m As Long
Dim v As Variant
Application.ScreenUpdating = False
m = Range("A:B").Find(What:="*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
v = Range("A1:B" & m).Value
For r = m To 3 Step -1
If v(r, 1) = v(r - 1, 1) Then
v(r, 1) = ""
v(r, 2) = ""
End If
Next r
Range("A1:B" & m).Value = v
Application.ScreenUpdating = True
End Sub
May 09 2021 03:02 AM
Thank you so much, this is helpful ..... Now I need to be familiar with Macro for sure :folded_hands::folded_hands:
May 09 2021 02:36 AM
SolutionHere is a macro that you can run:
Sub ClearDuplicates()
Dim r As Long
Dim m As Long
Dim v As Variant
Application.ScreenUpdating = False
m = Range("A:B").Find(What:="*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
v = Range("A1:B" & m).Value
For r = m To 3 Step -1
If v(r, 1) = v(r - 1, 1) Then
v(r, 1) = ""
v(r, 2) = ""
End If
Next r
Range("A1:B" & m).Value = v
Application.ScreenUpdating = True
End Sub