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

查看:28
本文介绍了将多张工作表中的同一行复制到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.

提前致谢.

推荐答案

这段代码会将7th行从所有前5张复制到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天全站免登陆