将多张纸中的同一行复制到Excel中的一张纸中 [英] copy the same row from multiple sheets into one sheet in excel

查看:64
本文介绍了将多张纸中的同一行复制到Excel中的一张纸中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将同一行从多张纸复制到一行.

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

示例:我有一个包含5张纸的Excel文件.我必须按工作表的顺序复制第6张工作表中每张工作表的第10行(或第15行或第21行).

Example: I have an excel file with 5 sheets. I have to copy the 10th row (or the 15th row, or the 21th row) of every sheet in a 6th sheet, in the order of the sheets.

谢谢.

推荐答案

此代码将从所有前5张 7th 行复制到 6th 工作表.

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

这篇关于将多张纸中的同一行复制到Excel中的一张纸中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆