注:每个sheet里有标题,标题保留没问题,就是将内容合并在一个sheet即可。
2 个解决方案
#1
Sub Macro1()
Dim dstSheet As Worksheet
Dim srcSheet As Worksheet
Dim dstRows As Long
Dim srcRows As Long
Application.DisplayAlerts = False
Set dstSheet = Sheets(1)
dstRows = dstSheet.Cells.SpecialCells(xlLastCell).Row
dstSheet.Activate
While Sheets.Count > 1
Set srcSheet = Sheets(2)
srcRows = srcSheet.Cells.SpecialCells(xlLastCell).Row
srcSheet.Rows("1:" & srcRows).Copy
dstSheet.Range("A" & (dstRows + 1)).Select
dstSheet.Paste
dstRows = dstRows + srcRows
srcSheet.Delete
Wend
Application.DisplayAlerts = True
End Sub
#2
使用KUTools工具,现将200个工作表分割为200个工作簿,再将200个工作簿汇总
#1
Sub Macro1()
Dim dstSheet As Worksheet
Dim srcSheet As Worksheet
Dim dstRows As Long
Dim srcRows As Long
Application.DisplayAlerts = False
Set dstSheet = Sheets(1)
dstRows = dstSheet.Cells.SpecialCells(xlLastCell).Row
dstSheet.Activate
While Sheets.Count > 1
Set srcSheet = Sheets(2)
srcRows = srcSheet.Cells.SpecialCells(xlLastCell).Row
srcSheet.Rows("1:" & srcRows).Copy
dstSheet.Range("A" & (dstRows + 1)).Select
dstSheet.Paste
dstRows = dstRows + srcRows
srcSheet.Delete
Wend
Application.DisplayAlerts = True
End Sub
#2
使用KUTools工具,现将200个工作表分割为200个工作簿,再将200个工作簿汇总