執行之後,選擇那個“檔案2”,點確定,就把“檔案2”裡"sheet3"的A1:L1000複製到執行文件“sheet1”的B2:M1001了~附件文件的模組1裡,按alt+f11開啟編輯器Sub a()Dim aWith Application.FileDialog(msoFileDialogFilePicker).AllowMultiSelect = False.InitialFileName = ThisWorkbook.PathIf .Show = -1 ThenSet a = Workbooks.Open(.SelectedItems(1))a.Sheets("sheet3").AutoFilterMode = Falsea.Sheets("sheet3").Range("A1:L1000").Copy ThisWorkbook.Sheets("sheet1").Range("B2")a.Close FalseEnd IfEnd WithEnd Sub
不用VBA就可以實現複製。
1、同時開啟兩個工作簿。
3、在移動或複製工作表彙總,選擇另一個工作簿。
執行之後,選擇那個“檔案2”,點確定,就把“檔案2”裡"sheet3"的A1:L1000複製到執行文件“sheet1”的B2:M1001了~附件文件的模組1裡,按alt+f11開啟編輯器Sub a()Dim aWith Application.FileDialog(msoFileDialogFilePicker).AllowMultiSelect = False.InitialFileName = ThisWorkbook.PathIf .Show = -1 ThenSet a = Workbooks.Open(.SelectedItems(1))a.Sheets("sheet3").AutoFilterMode = Falsea.Sheets("sheet3").Range("A1:L1000").Copy ThisWorkbook.Sheets("sheet1").Range("B2")a.Close FalseEnd IfEnd WithEnd Sub