您收到该错误,因为当您尝试粘贴到工作表时,工作表(sheetTo)不是活动工作表。 如果在代码中添加一行 Worksheets(sheetFrom).Cells(fromRow, fromCol).Copy Worksheets(sheetTo).Activate Worksheets(sheetTo).Cells(toRow, toCol).Select ActiveSheet.Paste Link:=True有用。 编辑以回应guitarthrower的答案: ...
#pastemethod #vba #1004 E Run-time error '1004': Pate method of worksheet class failed Hi guys, I'm scratching my head a little bit with this error. The VBA code I have, which pastes a screenshot, is as below. What I'm finding is that it is very temperamental. Some days the...
{"__ref":"Forum:board:ExcelGeneral"},"conversation":{"__ref":"Conversation:conversation:2833475"},"subject":"Re: VBA Copy table from email to Excel - Cannot paste the data - 1004","readOnly":false,"editFrozen":false,"moderationData":{"__ref":"ModerationData:moderation_...
Hi,I am trying to copy a table from email and paste it into Excel with VBA for further manipulation.I found code on the internet and all seems to work 100%,...
ActiveSheet.Paste Sheets(3).Select Range("A1").Select Application.CutCopyMode = False Range("A2").Select Application.CutCopyMode = False ActiveCell.FormulaR1C1 = "=data!RC" Range("A3").Select ActiveCell.Formula2R1C1 = "=IF(MOD(ROW(),2)=0,INDIRECT(ADDRESS(ROW()/2;1,COLUMN();10,,,...