[FONT=lucida console][color=Royalblue]Sub[/color] a1082990b()
[i][color=seagreen]'https://www.mrexcel.com/forum/excel-questions/1082990-duplicates-omissions.html[/color][/i]
[color=Royalblue]Dim[/color] rr [color=Royalblue]As[/color] [color=Royalblue]Long[/color], i [color=Royalblue]As[/color] [color=Royalblue]Long[/color], m [color=Royalblue]As[/color] [color=Royalblue]Long[/color], p [color=Royalblue]As[/color] [color=Royalblue]Long[/color]
[color=Royalblue]Dim[/color] q [color=Royalblue]As[/color] [color=Royalblue]Long[/color], r [color=Royalblue]As[/color] [color=Royalblue]Long[/color], j [color=Royalblue]As[/color] [color=Royalblue]Long[/color]
[color=Royalblue]Dim[/color] x [color=Royalblue]As[/color] [color=Royalblue]Variant[/color]
[color=Royalblue]Dim[/color] d [color=Royalblue]As[/color] [color=Royalblue]Object[/color], e [color=Royalblue]As[/color] [color=Royalblue]Object[/color]
Application.ScreenUpdating = [color=Royalblue]False[/color]
rr = Range([color=brown]"A:D"[/color]).Find([color=brown]"*"[/color], SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
va = Range([color=brown]"A1:D"[/color] & rr)
[color=Royalblue]Set[/color] d = CreateObject([color=brown]"scripting.dictionary"[/color])
d.CompareMode = vbTextCompare
[color=Royalblue]Set[/color] e = CreateObject([color=brown]"scripting.dictionary"[/color])
e.CompareMode = vbTextCompare
m = [color=crimson]1[/color]
[color=Royalblue]For[/color] j = [color=crimson]2[/color] [color=Royalblue]To[/color] UBound(va, [color=crimson]2[/color]) [color=Royalblue]Step[/color] [color=crimson]2[/color]
[color=Royalblue]For[/color] i = [color=crimson]1[/color] [color=Royalblue]To[/color] UBound(va, [color=crimson]1[/color])
x = Trim(va(i, j))
e(x) = va(i, j - [color=crimson]1[/color])
[color=Royalblue]If[/color] [color=Royalblue]Not[/color] d.Exists(x) [color=Royalblue]Then[/color]
d(x) = j
[color=Royalblue]Else[/color]
d(x) = [color=crimson]3[/color]
[color=Royalblue]End[/color] [color=Royalblue]If[/color]
[color=Royalblue]Next[/color]
[color=Royalblue]Next[/color]
[color=Royalblue]If[/color] d.Exists([color=brown]""[/color]) [color=Royalblue]Then[/color] d.Remove [color=brown]""[/color]
[color=Royalblue]For[/color] [color=Royalblue]Each[/color] x [color=Royalblue]In[/color] d
[color=Royalblue]If[/color] d(x) = [color=crimson]2[/color] [color=Royalblue]Then[/color] p = p + [color=crimson]1[/color]: Cells(p, [color=brown]"F"[/color]) = x: Cells(p, [color=brown]"E"[/color]) = e(x)
[color=Royalblue]If[/color] d(x) = [color=crimson]4[/color] [color=Royalblue]Then[/color] q = q + [color=crimson]1[/color]: Cells(q, [color=brown]"H"[/color]) = x: Cells(q, [color=brown]"G"[/color]) = e(x)
[color=Royalblue]If[/color] d(x) = [color=crimson]3[/color] [color=Royalblue]Then[/color] r = r + [color=crimson]1[/color]: Cells(r, [color=brown]"J"[/color]) = x: Cells(r, [color=brown]"I"[/color]) = e(x)
[color=Royalblue]Next[/color]
Application.ScreenUpdating = [color=Royalblue]True[/color]
[color=Royalblue]End[/color] [color=Royalblue]Sub[/color][/FONT]