+ Reply to Thread
Results 1 to 4 of 4

Error 91 while finding strings

  1. #1
    Registered User
    Join Date
    06-14-2012
    Location
    NYC
    MS-Off Ver
    Excel 2007
    Posts
    2

    Error 91 while finding strings

    My code goes through a column of search patterns (strings) on one worksheet, looking for each one in column on another sheet, and marking an 'x' two columns over where-ever the string is found.

    It works for many strings, but sometimes fails with error 91 for reasons that are unclear to me. Sometimes it's because of spaces in the string, special characters (* ' etc), or even just numbers in the string. I'm not sure what I'm doing wrong. I'd appreciate any insight folks can lend.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Error 91 while finding strings

    It fails because if the cell value is not found, the Find returns Nothing, and the Activate returns a runtime error.

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    06-14-2012
    Location
    NYC
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Error 91 while finding strings

    shg, thanks for your help.

    I get a 438 (Object doesn't support this property or method) on this line:

    Please Login or Register  to view this content.
    Don't see what the problem is here.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Error 91 while finding strings

    Oops:

    Please Login or Register  to view this content.

+ 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