copy the same row from multiple sheets into one sheet in excel

后端 未结 2 712
被撕碎了的回忆
被撕碎了的回忆 2021-01-27 00:12

I need to copy the same row from multiple sheets into one row.

Example: I have an excel file with 5 sheets. I have to copy the 10th row (or the 15th row, or the 21th row

2条回答
  •  执笔经年
    2021-01-27 00:28

    This code will copy 7th row from all first 5 sheets into 6th sheet.

    Sub row_copy()
    
    For i = 1 To Worksheets.Count - 1
    
    Sheets(i).Rows(7).Copy Sheets(6).Cells(i, 1)
    
    Next i
    
    End Sub
    

提交回复
热议问题