简体   繁体   English

将多个工作表合并为两个主工作表

[英]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.

相关问题 合并来自多个工作表的数据 - Consolidate data from multiple sheets 如何打开工作表并将它们合并到一个包含多个工作表的文件中? - How do I open sheets and consolidate them into 1 file with multiple sheets? 将多个工作簿中的多个工作表合并到一个具有相同工作表的工作簿中,但是将合并多个工作表中的数据 - Consolidate multiple sheets in multiple workbooks into one workbook with the same sheets but the data in the multiple sheets will be consolidated 使用多行标题合并来自多个工作表的数据 VBA - Consolidate data from multiple sheets with multiple rows of headers VBA 将来自两个“书挡”之间几张纸的数据合并为一张纸 - Consolidate data from several sheets between two “bookends” into one sheet 如何在Excel 2013中将多个工作表合并到数据透视表中 - How to consolidate multiple sheets into a pivot table in Excel 2013 将多张工作表中的列合并为另一张工作表上的单列 - Consolidate column from multiple sheets into single column on another sheet VBA脚本将多个Excel工作表合并为一个工作表 - VBA script to consolidate multiple excel sheets into one sheet 如何合并 Excel 工作表或合并它 - How to consolidate Excel sheets or merge it 将多个文件的可见工作表列出到主文件中 - List visible sheets of multiple files into a master file
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM