请帮我写一段VBA代码,让所有SHEET的内容合并到一个SHEET里面
时间: 2023-03-07 21:39:49 浏览: 111
复制目录下Execl文件sheet1表到新文件vba
Sub MergeSheets()
Dim ws As Worksheet
Dim destWS As WorksheetSet destWS = Worksheets("Sheet1")For Each ws In ActiveWorkbook.Worksheets
ws.UsedRange.Copy
destWS.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).PasteSpecial
NextEnd Sub
阅读全文