remove duplicates from an excel sheet

0

I have numerical data on sheet 2 and what I need is to eliminate the duplicate data, keeping the first data and eliminating the remaining data and the remaining ones sorting them in sheet 3 according to image

I have this code to delete but as I adapt it to the sheet

Sub Eliminar_repetidos()
Dim Dic, C As Range, Mat, Q&, i&, R&

Set Dic = CreateObject("Scripting.Dictionary")
On Error Resume Next
  For Each C In [a1].CurrentRegion
    If C <> "" Then Dic.Add C.Value, 0
  Next
On Error GoTo 0
Dic = Dic.keys: Q = UBound(Dic)
ReDim Mat(0 To Int(Q / 24), 0 To 23)
Do
  Mat(Int(i / 24), i - 24 * Int(i / 24)) = Dic(i)
  i = 1 + i
Loop Until i > Q

With [a1].CurrentRegion
  With .Cells(1).Offset(1 + .Rows.Count).Resize(1 + UBound(Mat), 24)
    Application.Goto .Cells(1).Offset(-2), True
    .NumberFormat = "@"
    .Value = Mat
  End With
End With
End Sub
    
asked by Jhon Fredy Murcia Rodriguez 20.04.2018 в 18:50
source

0 answers