Comparar dos listas y generar un listado único?
Para Dante Amor
De una pregunta anterior me he tomado la tarea de resolverla por si mismo, he avanzado algo, pero igual aún no tengo el resultado deseado. Lo que quiero es comparar dos listas de datos y generar una tercera lista con datos únicos a partir de un ID

resultado deseado

Sub Comparar2()
Application.ScreenUpdating = False
Set h1 = Sheets("Hoja1")
h1.Range("H4:L" & Rows.Count).ClearContents
r = 1
j = 4
For i = 4 To h1.Range("B" & Rows.Count).End(xlUp).Row
Set b = h1.Columns("B").Find(h1.Cells(i, "E"), lookat:=xlWhole)
Set c = h1.Cells(i, "E")
Set d = h1.Cells(i, "B")
u2 = h1.Range("i" & Rows.Count).End(xlUp).Row + 1
h1.Cells(u2, "H").Value = r
If Not b Is Nothing Then
h1.Cells(j, 9) = h1.Cells(b.Row, 2)
h1.Cells(j, 10) = h1.Cells(b.Row, 3)
h1.Cells(j, 11) = h1.Cells(c.Row, 6)
End If
If h1.Cells(d.Row, 2).Value <> h1.Cells(c.Row, 5).Value And h1.Cells(c.Row, 5).Value <> h1.Cells(d.Row, 2).Value Then
h1.Cells(j, 9) = h1.Cells(d.Row, 2)
h1.Cells(j, 10) = h1.Cells(d.Row, 3)
h1.Cells(j, 9) = h1.Cells(c.Row, 5)
h1.Cells(j, 11) = h1.Cells(c.Row, 6)
End If
r = r + 1
j = j + 1
Next
Application.ScreenUpdating = True
End Subpero no logro obtener lo que deseo

1 respuesta
Respuesta de Dante Amor
4
