失敗。錯誤在Excel 2010中,Range類的PasteSpecial方法下面是我的代碼的投擲這種錯誤中宏
Range(Cells(7, 1), Cells((Rowrange + 7), 2)).Select
Selection.PasteSpecial Paste:=xlValues
' my complete code
strSheetName = "sheet1"
Sheets(strSheetName).Select
B6 = Range("B6").Value
B7 = Range("B7").Value
Range(Cells(11, 1), Cells((Rowrange + 11), 2)).Select
Selection.Copy
strSheetName = "sheet2"
Sheets(strSheetName).Select
' Range(Cells(7, 1), Cells((Rowrange + 7), 2)).Select
'.Range(Cells(7,1), .Cells(RowRange + 7, 2). PasteSpecial Paste := xlValues
'Selection.PasteSpecial Paste:=xlValues
With ActiveSheet
.Range(.Cells(7, 1), .Cells(Rowrange + 7, 2)).PasteSpecial Paste:=xlValues
End With
有沒有辦法避免這個錯誤?
什麼是'RowRange'的價值? –
你可以顯示完整的代碼(包括複製代碼) –
你在哪裏複製粘貼?你需要首先複製粘貼;) –