Hello,

I have a VBA code that hide any duplicate data based on column G. Instead of hidding data, can anyone help me modify it to delete duplicate data based on any rows from column G. Below is my code and thanks.

Sub HideDups()
     
    Dim x               As Long
    Dim LastRow         As Long
     
    LastRow = Range("G65536").End(xlUp).Row
    For x = LastRow To 1 Step -1
        If Application.WorksheetFunction.CountIf(Range("G10:G" & x), Range("G10" & x).Text) > 1 Then
            Range("G10" & x).EntireRow.Hidden = True
        End If
    Next x
     
End Sub