Select Method Of Range Class Failed

  • I get the following error:
    Run-time error '1004': Select method of Range class failed
    at the following code line:

    Code
    Worksheets("Sheet1").Range("A6").Select


    Why? What is wrong with Excel?

  • Re: Select Method Of Range Class Failed


    When that line of code is executed, is Sheet1 the active sheet?

    Regards,


    Wigi


    Excel MVP 2011-2014


    For more Excel memes: visit http://www.wimgielis.com ==> English articles ==> Excel memes


    -- Topics without [CODE] tags or a meaningful topic title, will be neglected by me (and probably many others as well) --

  • Re: Select Method Of Range Class Failed


    No... Sheet2 is the active sheet, I think. :confused:
    I mean, the click-button to which this macro is attached is placed in Sheet2.

  • Re: Select Method Of Range Class Failed


    So as Wigi was alluding to you need to activate the sheet first before trying to select a cell upon it.


    [vba]Worksheets("Sheet1").Activate
    Range("A6").Select
    [/vba]


    Or if you must do it in a single command
    [vba]application.goto Worksheets("Sheet1").Range("A6")[/vba]

    [h4]Cheers
    Andy
    [/h4]

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!