返回列表 上一主題 發帖

[發問] 將總表的資料, 分別匯入不同WORKBOOK指定的WORKSHEET裡面

回復 1# idsmchow
就好像一個 "餅" 分給指定的人一樣.
你要上傳範例 說清楚 "餅" 要分送出去的條件,

TOP

回復 4# idsmchow
  1. Sub Ex()
  2.     Dim E As Range, FilePath As String
  3.     FilePath = "D:\TEST\"   'Workbooks File 存放的資料夾
  4.     With Workbooks("Summary Sheet.xls").Sheets(1)
  5.         For Each E In .Range(.[a2], .[a2].End(xlDown)) 'Branch Code 範圍
  6.             With Workbooks.Open(FilePath & E & ".XLS")
  7.                 .Sheets(1).[C16].End(xlUp).Offset(1) = E.Offset(, 1)
  8.                 .Close True                            '關閉 存檔
  9.             End With
  10.         Next
  11.     End With
  12. End Sub
複製代碼

TOP

        靜思自在 : 自己害自己,莫過於亂發脾氣。
返回列表 上一主題