Share via

Runtime error 1004 - select method or range class failed

Anonymous
2013-06-20T17:44:13+00:00

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?

Microsoft 365 and Office | Excel | For home | Windows

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.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Anonymous
    2013-06-20T18:45:06+00:00

    Mike:

    Sorry, forgot to put that into my question.  Scope is workbook.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2013-06-20T17:56:40+00:00

    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

    Was this answer helpful?

    0 comments No comments