+ Reply to Thread
Results 1 to 6 of 6

Select method of Range class failed" error message

  1. #1
    Registered User
    Join Date
    09-03-2004
    Posts
    9

    Select method of Range class failed" error message

    Hey guys,

    My macro is searching for a string in a cell, then upon finding it, select the entire row and copy/paste it to another sheet. However, I am getting a "Select method of Range class failed" error message when I try to select the entire row. Can someone check this out?
    Please Login or Register  to view this content.
    TIA!
    Last edited by Session101; 11-13-2009 at 12:59 AM.

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Select method of Range class failed" error message

    Per the Forum rules you agreed to follow, all VBA code must be wrapped in code tags. Please amend your post by applying code tags. How: highlight all of the code then click the # button.

    After complying with the rule for code tags solutions to your question will be provided.

    Thanks.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Registered User
    Join Date
    09-03-2004
    Posts
    9

    Re: Select method of Range class failed" error message

    I apologize as I forgot. My post has been amended. Thanks.

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,936

    Re: Select method of Range class failed" error message

    Try adding the line: Sheets("Trades").Select before the While...

    Also, when pasting to the second sheet I got a warning message: 'areas not the same size...' so I changed the line: Rows(CStr(LCopyToRow) & ":" & CStr(LCopyToRow)).Select to
    Please Login or Register  to view this content.
    Ben Van Johnson

  5. #5
    Forum Contributor
    Join Date
    09-22-2009
    Location
    Indianapolis, Indiana
    MS-Off Ver
    Office 2003 / Office 2007
    Posts
    114

    Re: Select method of Range class failed" error message

    Please Login or Register  to view this content.
    x is the row being copied, y is the row you are going to copy to. Just use a counter for Y most likely, and you are home free. No selection / activation of sheets needed.

  6. #6
    Registered User
    Join Date
    09-03-2004
    Posts
    9

    Re: Select method of Range class failed" error message

    Thanks everyone! Marzuk, I used the Copy Sheets function and that worked perfectly!

+ 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