Sub 加入檔案()
With Application.FileDialog(msoFileDialogOpen)
.InitialFileName = "D:\"
.AllowMultiSelect = True
.Show
For i = 1 To .SelectedItems.Count
Cells(i, 2) = .SelectedItems(i)
Next
End With
End Sub
Sub 執行()
Application.ScreenUpdating = False
For i = 1 To .SelectedItems.Count
inbook = Worksheets("Filelist").Cells(i, 2).Value
Workbooks.Open Filename:=inbook
Next
End Sub作者: mark15jill 時間: 2012-10-2 08:29
請問如何將以下執行檔改成可選取儲存在不同SHEET???
Sub 執行()
For Each a In Range([A1], Cells(Rows.Count, 1).End(xlUp))
With Workbooks.Open(a)..............這裡的小寫a,在vba理會跳成大寫A, 有關係嗎
.Sheets(1).[A1:C6].Copy
ThisWorkbook.Sheets("Result").Cells(Rows.Count,1).End(xlUp).Offset(1)
.Close 0
End With
Next
End Sub