f = Application.GetOpenFilename(FileFilter:="Excel Files (*.xls),*.xls", Title:="選擇多個檔案", MultiSelect:=True)
If Not IsArray(f) Then Exit Sub
Application.ScreenUpdating = False
'需要先建一個叫"彙整"的工作表
r = 1
For Each fname In f
With Workbooks.Open(fname)
.Sheets(1).Range("3:3,5:5,10:10,11:11").Copy ThisWorkbook.Sheets("彙整").Cells(r, "A")
r = r + 4 '每次新增4列
.Close False
End With
Next
Application.ScreenUpdating = True
End Sub作者: 3171jj 時間: 2013-4-28 00:43