Hola! Sergio. Intenta con:
Código Java:
Ver originalSub Intercalar()
Dim i%, Q&, R&, Mat1, Mat2
Mat1 = Range([a1], [a1].End(xlDown)): Q = UBound(Mat1)
ReDim Mat2(1 To Q + Evaluate("sum(if(a1:a" & Q - 1 & " = a2:a" & Q & ", 1))"), 1 To 1)
For i = 1 To Q - 1
R = IIf(Mat1(i, 1) = Mat1(1 + i, 1), 2, 1) + R
Mat2(R, 1) = Mat1(i, 1)
Next
Mat2(1 + R, 1) = Mat1(i, 1)
[d1].Resize(1 + R) = Mat2: Erase Mat1, Mat2
End Sub