A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Mike:
Sorry, forgot to put that into my question. Scope is workbook.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have an Excel workbook with 3 sheets, Orders, Plan, Budget. On the plan sheet, I have a named range called lastytd. I have verified that the range definition in the name manager is correct and points to the correct range on the plan sheet. When I reach the following line of code in my moldule1, I get Runtime error 1004 - select method or range class failed
Worksheets("plan").Range("lastytd").Select
What am I doing wrong?
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Mike:
Sorry, forgot to put that into my question. Scope is workbook.
Hi,
What is the scope of the named range? If the scope of the range isn't 'Workbook' then if you try to select it and the sheet 'Plan' isn't the active sheet then that line will fail.
Check the scope in the Name manager.
This should work with the usual caveat that it's very unlikely you need to select a range to do something with it.
Worksheets("plan").Select
Range("lastytd").Select