|
数据写在备注列供对比
Sub lx()
Dim r(), r1, r2, r3, i%, a%, b%
a = Sheet1.Range("l4").End(xlDown).Row
b = Sheet1.Range("n4").End(xlDown).Row
r1 = Sheet1.Range("l4:l" & a)
r2 = Sheet1.Range("n4:n" & b)
r3 = Sheet1.Range("p4:p" & a)
ReDim r(1 To 2 * UBound(r1) + UBound(r2), 1 To 1)
For i = 1 To UBound(r2)
r(5 * (i - 1) + 1, 1) = r1(2 * (i - 1) + 1, 1)
r(5 * (i - 1) + 2, 1) = r1(2 * (i - 1) + 2, 1)
r(5 * (i - 1) + 3, 1) = r2(i, 1)
r(5 * (i - 1) + 4, 1) = r3(2 * (i - 1) + 1, 1)
r(5 * (i - 1) + 5, 1) = r3(2 * (i - 1) + 2, 1)
Next i
[h7].Resize(UBound(r), 1) = r
End Sub |
|