程式修改以後為以下,但我不是我的原意,我希望將程式中的("Shipping for ACE.xlsx") 替換掉,要如何以"貼簽名.xlsm"的"EX" sheet的指定儲存格D3/ G3內的檔名,取代程式中的檔名With Workbooks("Shipping for ACE.xlsx") ?
Sub copy_signed()
Dim Rng(1 To 3) As Range, xi As Integer
Workbooks("貼簽名.xlsm").Sheets("Signed").Pictures("Picture 1").Copy
With Workbooks("Shipping for ACE.xlsx") '***改一改成這樣:前面的With ActiveSheet就沒作用
Set Rng(1) = .Sheets("PKG").[r:r].Find("B. C. MART COMPANY LTD.", LOOKAT:=xlPart).Offset(2, -2)
Set Rng(2) = .Sheets("INV").[Q:Q].Find("B. C. MART COMPANY LTD.").Offset(2, -2)
Set Rng(3) = .Sheets("SCD").[B:B].Find("Signature:").Offset(1, 1)
End With
For xi = 1 To 3
Rng(xi).Parent.Activate
Rng(xi).Activate
ActiveSheet.Paste
Next
End Sub作者: GBKEE 時間: 2012-11-4 16:17