+ Reply to Thread
Results 1 to 4 of 4

Run Time Error 1004 when selecting range on another sheet using a command button

  1. #1
    Forum Contributor
    Join Date
    07-24-2008
    Location
    San Antonio, Texas
    Posts
    118

    Run Time Error 1004 when selecting range on another sheet using a command button

    I have created a command button that plays the following macro.

    Please Login or Register  to view this content.
    The command button is on Sheet1 and when I click the command button and the macro plays it will select Sheet2 and the range B10:C19, and returns a Run Time Error '1004': Select method of Range class failed.

    I have tried to play the macro without using the command button and it will select the range from Sheet2 without any problems/errors. I change the macro to select the range on Sheet1 and it works fine. I know the issue has something to do with the command button and can not figure it out.

    I am not sure what I am missing. Any help would be greatly appreciated.
    Last edited by randolphoralph; 11-20-2009 at 05:02 PM.

  2. #2
    Forum Contributor
    Join Date
    04-01-2009
    Location
    Irvine, CA
    MS-Off Ver
    Excel 2010
    Posts
    280

    Re: Run Time Error 1004 when selecting range on another sheet using a command button

    Just add the sheet reference to the range...

    Please Login or Register  to view this content.
    The code is executing from Sheet1, so when Sheet2 is selected it is trying to select the range on Sheet1 (the Macro is not tied to the sheet, so that's why it works).

  3. #3
    Forum Contributor
    Join Date
    07-24-2008
    Location
    San Antonio, Texas
    Posts
    118

    Thumbs up Re: Run Time Error 1004 when selecting range on another sheet using a command button

    It worked! Thank you so much

  4. #4
    Registered User
    Join Date
    12-06-2013
    Location
    tvrd
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: Run Time Error 1004 when selecting range on another sheet using a command button

    thanks much

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1