[英]consolidate multiple sheets into two master sheets
I have a workbook with 15 sheets for different business lines. 我有一本有15张纸的工作簿,用于不同的业务领域。
This workbook is a template with multiple empty rows on each sheet. 该工作簿是一个模板,每张纸上有多个空行。
I would like to consolidate sheets 1, 4, 7, 10, and 13 into a master sheet that adds only rows that are not empty. 我想将表1、4、7、10和13合并为一个主表,该表仅添加不为空的行。
In addition, I would like to consolidate sheets 2, 5, 8, 11, and 14 into a master sheet that adds only rows that are not empty. 另外,我想将表2、5、8、11和14合并为一个主表,该表仅添加不为空的行。
I believe this can be done with VBA, but I don't know how to do that. 我相信这可以通过VBA来完成,但是我不知道该怎么做。
The following is only a part of your issue. 以下只是您问题的一部分。
This code use filter to eliminate blanks on the first column and copy the data on a new sheet. 此代码使用过滤器消除第一列上的空白,并将数据复制到新的工作表上。
Sub SelectNonBlankAndPasteonNewSheet()
Cells.Select
Selection.AutoFilter
With Selection
.AutoFilter Field:=1, Criteria1:="<>"
.SpecialCells(xlCellTypeVisible).Copy
End With
Sheets.Add After:=ActiveSheet
ActiveSheet.Paste
End Sub
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.