发布网友 发布时间:2022-04-25 20:41
共2个回答
热心网友 时间:2022-06-17 06:01
Sub 自动填充()
Dim i As Integer, name
name = Array("表1", "表2", "表3", "表4", "表5", "表6", "表7")
For i = 0 To UBound(name)
Windows(name(i) & ".xls").Activate
ActiveWorkbook.Worksheets(name(i)).Range("A1:BE183").Copy Workbooks("汇总.xls").Worksheets(name(i)).Range("A1")
Windows("汇总.xls").Activate
Next i
End Sub
前提条件是所有的工作簿都要先打开。
热心网友 时间:2022-06-17 06:02
For i = 0 To 6
Workbooks(name(i) & ".xls").Sheets(name(i)).Copy Before:=Workbooks("汇总.xls").Sheets(1)
Next i