Te anexo otra macro. En mis pruebas la macro dura 2 minutos, revisé algunos resultados.
Revisa todos los resultados y dime si es lo que necesitas.
Sub BuscarNit()
'Por.Dante Amor
Application.ScreenUpdating = False
'
u = Range("F" & Rows.Count).End(xlUp).Row
With ActiveSheet.Sort
.SortFields.Clear
.SortFields.Add Key:=Range("A2:A" & u), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
.SortFields.Add Key:=Range("E2:E" & u), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
.SortFields.Add Key:=Range("F2:F" & u), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
.SetRange Range("A1:G" & u)
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Columns("H").ClearContents
Columns("C").Replace What:="#N/A", Replacement:=""
'
n = 2
For i = 2 To u
If Cells(i, "C") = "" Then
Application.StatusBar = i & " de " & u
una = True
sigue = False
Set r = Range("F" & n & ":F" & i - 1)
Set b = r.Find(Cells(i, "F"), LookAt:=xlWhole)
If Not b Is Nothing Then
ncell = b.Address
If b.Row <> i Then
Do
If Cells(b.Row, "A") = Cells(i, "A") And _
Cells(b.Row, "E") = Cells(i, "E") Then
If una Then
nit = Cells(b.Row, "C")
nom = Cells(b.Row, "D")
una = False
sigue = True
Else
If nit <> Cells(b.Row, "C") Then
sigue = False
Exit Do
End If
End If
End If
Set b = r.FindNext(b)
Loop While Not b Is Nothing And b.Address <> ncell And b.Row <> i
End If
If sigue Then
Cells(i, "C") = nit
Cells(i, "D") = nom
Cells(i, "H") = "Completado"
Else
Cells(i, "H") = "Tiene varios NIT"
End If
End If
n = i
End If
Next
Application.StatusBar = False
Application.ScreenUpdating = True
MsgBox "Proceso terminado"
End Sub
Saludos.Dante Amor
Si es lo que necesitas. No olvides valorar la respuesta.