回覆列表
  • 1 # 秦羽

    可採用如下程式碼。該檔案儘量不要放在目標資料夾中。執行時,只執行該workbook,其餘關閉。其中的副檔名(xls還是xlsx需要你確認一下,可更改)Sub Data_Col()Dim my_Path As StringApplication.FileDialog(msoFileDialogFolderPicker).Showmy_Path = Application.FileDialog(msoFileDialogFolderPicker).SelectedItems(1)Dim my_Doc As Stringmy_Doc = Dir(my_Path & "\" & "*.xlsx") "手動更改副檔名Dim j As Singlej = 1Do While Len(my_Doc) 0Workbooks.Open (my_Path & "\" & my_Doc)ThisWorkbook.Worksheets(1).Cells(j,1)=my_docDim i As SingleFor i = 2 To 12ThisWorkbook.Worksheets(1).Cells(j, i) = Workbooks(2).Worksheets("TEST -RESULT").Cells(29, i)NextWorkbooks(2).Closemy_Doc = Dirj = j + 1LoopEnd Sub

  • 中秋節和大豐收的關聯?
  • TBC70級副本的難度順序由低到高是怎樣的?