我想從另一個Excel工作表粘貼值,但我的代碼在下面一直返回一個錯誤。我究竟做錯了什麼 ?VBA-粘貼值錯誤
設置tempWB = Application.Workbooks.Open(vrtSelectedItem)「這將打開工作簿參考
Sheets("Portfolio Worksheet 8.8").Select 'SELECT A SHEET if you need to
Range("B16:B30").Select 'select SOME RANGE
Selection.Copy 'COPY SOME RANGE
mainWB.Activate 'activate your main workbook
Sheets("Sheet1").Select 'select target sheet
Range("C20").Select 'select target cell
ActiveSheet.PasteSpecial xlPasteValues 'paste the data from the reference worksheet
tempWB.Save 'save and close the reference workbook
tempWB.Close
有什麼錯誤? – 2014-09-12 15:44:14