0
votes

I am new to VBA and I am trying to copy rows from sheet1, Sheet2 & Sheet3 to final sheet in the same work book.

All the three sheet have same no. of rows. Macro which I want should first copy Row no. 2 from sheet1 and paste it to Final Sheet then copy Row no. 2 from Sheet2 and paste it to final sheet below the earlier copied row and then from sheet 3 to final sheet below the already pasted rows.

This should be repeat till all the rows in all the sheet is copied and pasted to final sheet.

Thanks in advance and sorry if I had made repetitions.

1

1 Answers

0
votes

This is the one of the variants

Sub test()
Dim i&, z& 'Long type
i = 2: z = 2
While z <> 100
    Sheets("Sheet2").Rows(z).Copy Sheets("Sheet1").Rows(i):    i = i + 1
    Sheets("Sheet3").Rows(z).Copy Sheets("Sheet1").Rows(i):    i = i + 1
    Sheets("Sheet4").Rows(z).Copy Sheets("Sheet1").Rows(i):    i = i + 1
    z = z + 1
Wend
End Sub