請問一下大大...最近又拿起這個巨集自己修改一下..
將別樣資訊帶入報表中~只是有一個疑問是成功複製過去了...但如何讓他指定去 R S T U 欄位呢
目前執行後 會再J欄旁邊K欄位依序往右邊存放
[attach]22814[/attach]
[attach]22815[/attach]
A檔案內容如下圖~~~
[attach]22816[/attach]
Public Sub ex()
Dim bSh As Worksheet, aSh As Worksheet
Dim ARng As Range, BRng As Range
mPath = ThisWorkbook.Path & "\" '設定路徑為和C檔案同路徑
bData = "FMC.xls" '設定B檔案的完整名稱(報表)
aData = "吸嘴Table.xls" '設定A檔案的完整名稱(Table)
Set aSh = Workbooks.Open(mPath & aData).Worksheets("Rubber Tip") '設定aSh是A檔案的FMC工作表物件,打開A檔案(Table)
Set bSh = Workbooks.Open(mPath & bData).Worksheets("FMC") '設定bSh是B檔案的FMC工作表物件,打開B檔案(報表)
For Each ARng In aSh.Range("A2:A" & aSh.Cells(65535, 2).End(xlUp).Row) 'ARng為A檔案.Worksheets("FMC")的B欄(Table)
For Each BRng In bSh.Range("J7:J" & bSh.Cells(65535, 2).End(xlUp).Row) ''BRng為B檔案.Worksheets("FMC")的B欄(報表)