Hello everyone,
I am trying to create a formula that clears the fourth duplicate by removing the whole row using "clear contents." So far, my formula grabs all the unique data points from one column and pastes them into another column. Finally, it filters the entire worksheet using the first forty-one unique data points that were moved into the other column. So for the last step of my formula, I need it to clear any rows that have a fourth duplicate in column C. Below is the formula I use for what I just explained. If this is not possible, could the cell with the fourth duplicate be cleared using "clear contents"?
Sub Get_Unique_Values1()
Dim row As Long
row = Cells(Rows.Count, "C").End(xlUp).row
ActiveSheet.Range("C7:C" & row).AdvancedFilter _
Action:=xlFilterCopy, CopyToRange:=ActiveSheet.Range("X7"), _
Unique:=True
Application.CutCopyMode = False
Application.CutCopyMode = False
Application.CutCopyMode = False
Range("C7:C80").AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:= _
Range("X7:X47"), Unique:=False
End Sub
I am trying to create a formula that clears the fourth duplicate by removing the whole row using "clear contents." So far, my formula grabs all the unique data points from one column and pastes them into another column. Finally, it filters the entire worksheet using the first forty-one unique data points that were moved into the other column. So for the last step of my formula, I need it to clear any rows that have a fourth duplicate in column C. Below is the formula I use for what I just explained. If this is not possible, could the cell with the fourth duplicate be cleared using "clear contents"?
Sub Get_Unique_Values1()
Dim row As Long
row = Cells(Rows.Count, "C").End(xlUp).row
ActiveSheet.Range("C7:C" & row).AdvancedFilter _
Action:=xlFilterCopy, CopyToRange:=ActiveSheet.Range("X7"), _
Unique:=True
Application.CutCopyMode = False
Application.CutCopyMode = False
Application.CutCopyMode = False
Range("C7:C80").AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:= _
Range("X7:X47"), Unique:=False
End Sub