+ Reply to Thread
Results 1 to 2 of 2

message box indicating "no result found" when a cell value is not found in a sheet

  1. #1
    Registered User
    Join Date
    09-13-2021
    Location
    India
    MS-Off Ver
    365
    Posts
    36

    Question message box indicating "no result found" when a cell value is not found in a sheet

    Hello everyone,

    I am really new to macro. I found the below code from the forum. The code works by looking for the word in the active cell to the rest of the worksheet, if the word match is found in a cell; the cell is filled with yellow color. In addition, I would like to incorporate MsgBox "No result found" if the match is not found in the below code. Currently if the word match is not found in the worksheet, a warning message is shown by excel "Run time error 91: Object variable or with block variable not set". Can anyone please help me with this query?
    Please Login or Register  to view this content.
    Moderator's note: Please do not attach text files with code. Either attach your entire Excel file, or put the code in your post with CODE tags. I have done this for you. --6StringJazzer
    Last edited by Lona; 09-23-2021 at 08:23 AM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: message box indicating "no result found" when a cell value is not found in a sheet

    Give this a try:

    Please Login or Register  to view this content.

    Also I ran your code and did not get an error when the value was not found. What line of code did this error occur on?
    Last edited by 6StringJazzer; 09-13-2021 at 11:16 AM.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Error message "We found a problem with this forumla"
    By alexplex in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-23-2016, 05:29 AM
  2. If File Not Found In Either Directory Then Message "File Not Found"
    By rjj920 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-14-2016, 06:59 PM
  3. Replies: 2
    Last Post: 09-19-2013, 09:10 AM
  4. [SOLVED] Instead of showing #N/A and #REF!, i want the result show as "Not Found" and "Found"
    By DonnyLau in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-11-2013, 08:58 AM
  5. Message "parametervalue.xlsx could not be found. Check spelling..."
    By ChristineM in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-20-2012, 02:19 PM
  6. Vlookup - 3 tables -- Return "Not Found" if no result
    By SimpleJack in forum Excel General
    Replies: 1
    Last Post: 09-02-2011, 11:20 AM
  7. error message "match not found for row "
    By jazbath in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-20-2009, 05:44 PM

Tags for this Thread

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