![]()
Sub ertert22() Dim x, y, res(), i&, j&, k& With Sheets("Sheet1") x = .Range("A1:B" & .Cells(Rows.Count, 1).End(xlUp).Row).Value End With With Sheets("Sheet2") y = .Range("A1:B" & .Cells(Rows.Count, 1).End(xlUp).Row).Value End With ReDim res(1 To UBound(x) * UBound(y), 1 To 4) For i = 1 To UBound(x) For j = 1 To UBound(y) k = k + 1 res(k, 1) = x(i, 1): res(k, 2) = x(i, 2) res(k, 3) = y(j, 1): res(k, 4) = y(j, 2) Next j Next i Sheets("Sheet3").Range("A1:D1").Resize(k).Value = res() End Sub
Bookmarks