i try to remove non-duplicate data and keep the duplicate data i've done some coding, but nothing happen, oh. it's error. lol
this is my code.
Sub mukjizat2()
Dim desc As String
Dim sapnbr As Variant
Dim shortDesc As String
X = 1
i = 2
desc = Worksheets("process").Cells(i, 3).Value
sapnbr = Worksheets("process").Cells(i, 1).Value
shortDesc = Worksheets("process").Cells(i, 2).Value
Do While Worksheets("process").Cells(i, 1).Value <> ""
If desc = Worksheets("process").Cells(i + 1, 3).Value <> Worksheets("process").Cells(i, 3) Or Worksheets("process").Cells(i + 1, 2) <> Worksheets("process").Cells(i, 2) Then
Delete.EntireRow
Else
Worksheets("output").celss(i + 1, 3).Value = desc
Worksheets("output").Cells(i + 1, 1).Value = sapnbr
Worksheets("output").Cells(i + 1, 2).Value = shortDesc
X = X + 1
End If
i = i + 1
Loop
End Sub
what have i done wrong?
what i expect :
before :
sapnbr | ShortDesc | Desc
11 | black hat | black cowboy hat vintage
12 | sunglasses| black sunglasses
13 | Cowboy hat| black cowboy hat vintage
14 | helmet 46 | legendary helmet
15 | v mask | vandeta mask
16 | helmet 46 | valentino rossi' helmet replica
after
sapnbr | ShortDesc | Desc
11 | black hat | black cowboy hat vintage
13 | Cowboy hat| black cowboy hat vintage
14 | helmet 46 | legendary helmet
16 | helmet 46 | valentino rossi' helmet replica
UPDATE, using coding by @siddhart, the unique value deleted, but not all,

Delete.EntireRowIs that a comment?