Sub Macro3()
'
' Macro3 Macro
'
'
Dim MyFile As String
MyFile = Application.GetOpenFilename(MultiSelect:=True)
Workbooks.Open (MyFile)
Range("A2").Select
Range(Selection, Selection.End(xlDown)).Select
Application.DisplayAlerts = False
Selection.Copy
ActiveWorkbook.Close
Application.DisplayAlerts = True
Windows("Jane macro test.xlsx").Activate
Sheets("Sheet2").Select
Range("B2").Select
lMaxRows = Cells(Rows.Count, "B").End(xlUp).Row
Range("B" & lMaxRows + 1).Select
ActiveSheet.Paste
End Sub
它一直說我的代碼有運行時錯誤13和不匹配。任何人都知道如何解決?如果我將MultiSelect更改爲False,我可以使用它,但我需要它在多個文件夾上運行。我該如何去做呢?如何調試這個Excel的麻煩?
你知道如何「F8」,並通過代碼? – ja72