Hope this user guide can help you if you find that the runtime error 1004 is application specific or the error identified by the object is Excel.
Runtime error 1004 occurs when the macro being run copies the original sheet into a workbook with a unique name that you did not save and close before running the macro. 8 February 2020
1
I have a problem with error 1004 “Application or object specific error” when selecting a range.
I can still select lines (ie select lines ("21:21").
) and select areas on other sheets in the same workbook. I don’t think the error is in the code. Maybe I don’t know that?
I have used the same code a few times before, but for some reason I cannot get it to work in this subroutine (I commented where the error occurs) …
in CopySheet1_to_PasteSheet2 () Dim CLastFundRow as integer Dim CFirstBlankRow as integer 'Find the last line of content Windows ("Excel.xlsm"). Activate Sheets ("Sheet1"). Activate Zone ("C21"). To choose '>>> Error 1004' Application or object specific error '. Selection.End (xlDown) .Select CLastFundRow = ActiveCell.Row 'Find the first line with no content CFirstBlankRow = CLastFundRow 1 'Copy data Range ("A21: C" and CLastFundRow). Choose Selection.Copy 'Insert data values Tables ("PalTrakExport PortfolioAIdName"). To choose Zone ("A21"). To choose Selection.PasteSpecial Paste: = xlPasteValues, operation: = xlNone, SkipBlanks _: = False, transpose: = False 'Return uniformity over the top of the sheet Zone ("A21"). To choose Zone ("A1"). To chooseEnd of subscription
I need to do my best when copying because the number of lines changes frequently. Again, the following code was previously used without error … but not in this case.
Dim CLastFundRow As IntegerDim CFirstBlankRow as integer'Find the last line of contentWindows ("Excel.xlsm"). ActivateSheets ("Sheet1"). ActivateZone ("C21"). To choose '>>> Error 1004' Application or object specific error '.Selection.End (xlDown) .SelectCLastFundRow = ActiveCell.Row'Find the first line with no contentCFirstBlankRow = CLastFundRow 1
