Sub text()
Dim MyFile, i As Long, sh As Excel.Worksheet
MyFile = xlapp.GetOpenFilename(fileFilter:="Excel文件(*.xls),*.xls", Title:="选择Excel文件", MultiSelect:=True)
If TypeName(MyFile) = "Boolean" Then Exit Sub
xlapp.ScreenUpdating = False
Set sh = xlapp.ActiveSheet
For i = 1 To UBound(MyFile)
If MyFile(i) <> xlapp.ActiveWorkbook.FullName Then
With GetObject(MyFile(i))
.Sheets("sheet1").UsedRange.Offset(5).Copy sh.Range("a" & xlapp.Rows.Count).End(xlUp).Offset(1)
.Close 0
End With
End If
Next
xlapp.ScreenUpdating = True
End Sub
Dim MyFile, i As Long, sh As Excel.Worksheet
MyFile = xlapp.GetOpenFilename(fileFilter:="Excel文件(*.xls),*.xls", Title:="选择Excel文件", MultiSelect:=True)
If TypeName(MyFile) = "Boolean" Then Exit Sub
xlapp.ScreenUpdating = False
Set sh = xlapp.ActiveSheet
For i = 1 To UBound(MyFile)
If MyFile(i) <> xlapp.ActiveWorkbook.FullName Then
With GetObject(MyFile(i))
.Sheets("sheet1").UsedRange.Offset(5).Copy sh.Range("a" & xlapp.Rows.Count).End(xlUp).Offset(1)
.Close 0
End With
End If
Next
xlapp.ScreenUpdating = True
End Sub