Hi everyone
I got this code on your site.
How can I adapt it if the data is discontinuous in the comparison column (column A of the report sheet).
that is, there are empty cells.
Thank you.
I got this code on your site.
How can I adapt it if the data is discontinuous in the comparison column (column A of the report sheet).
that is, there are empty cells.
Thank you.
VBA Code:
Sub ItzybellDUE()
Dim Ary As Variant
Dim i As Long, j As Long
Ary = Sheets("dati").Range("A2").CurrentRegion.Value2
With Sheets("report")
j = .Range("A" & Rows.Count).End(xlUp).Row
For i = UBound(Ary) To 2 Step -1
If .Cells(j, 1).Value = Ary(i, 1) Then
j = j - 1
Else
Rows(j + 1).Insert
.Cells(j + 1, 1).Resize(, 2).Value = Array(Ary(i, 1), Ary(i, 2))
End If
Next i
End With
End Sub