+ Reply to Thread
Results 1 to 4 of 4

find and replace crashes when value is not present.

  1. #1
    Registered User
    Join Date
    10-23-2011
    Location
    Ohio
    MS-Off Ver
    Excel 2003
    Posts
    11

    find and replace crashes when value is not present.

    hello,

    I created a macro that I want to use across all my workbooks, it finds abbreviation and replaces it with the full name. Unfortunately it crashes when the abbreviation I am looking for is not there. If anyone can help me I appreciate it. my code and the file is attached.

    Please Login or Register  to view this content.
    Attached Files Attached Files

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

    Re: find and replace crashes when value is not present.

    Crashes on what line with what error?
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    10-23-2011
    Location
    Ohio
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: find and replace crashes when value is not present.

    Please Login or Register  to view this content.
    crashes at that line because "usa" is not present on the current workbook.

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

    Re: find and replace crashes when value is not present.

    Set an object variable and test it:

    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