+ Reply to Thread
Results 1 to 9 of 9

Create error message when VLOOKUP formula returns specific value

  1. #1
    Registered User
    Join Date
    02-09-2015
    Location
    California, United States
    MS-Off Ver
    MS Office 2010
    Posts
    5

    Create error message when VLOOKUP formula returns specific value

    Hi everyone! I am hoping someone can help me with this problem. Is there a way to have an error message pop up when a cell with a vlookup formula returns a specific value.

    For example:

    I have a workbook with two tabs. Tab one is my master list of names with names in column one and column two is if there are missing documents in their file. In tab two (my daily working tab) I have a pull down list in which column one is a pull down from the list of names from the master tab. Column two is a vlookup formula to lookup the "missing documents" column from the master list after the name has been selected from the pull down list.

    Is there a way that once the name is selected from the drop down list and the vlookup formula has returned a specific value to have an error message pop up to let the inputter know there are documents missing.

    I have attached my test document as an example as well. I hope someone out there can help me out!! THANK YOU!!
    Attached Files Attached Files

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Create error message when VLOOKUP formula returns specific value

    Hello,

    if you want to pop up an error message, you would need VBA. Are you comfortable with that?

    As a formula alternative, you can use conditional formatting to turn the row red or something when Vlookup returns Yes.

    For the conditional formatting approach, select A1 to B6, then click on the Home ribbon Conditional Formatting > New Rule > use a formula ... > enter this formula

    =$B1="Yes"

    then select a format like a red fill color. Now the table row will light up in red if the value in column B of that row is "Yes".

    A pop up would appear once. The conditional format will stay and be a visible warning to the user until the value of the cell in column B changes.

    See attached.

    cheers, teylyn
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    02-09-2015
    Location
    California, United States
    MS-Off Ver
    MS Office 2010
    Posts
    5

    Re: Create error message when VLOOKUP formula returns specific value

    Thanks for this! Yes I was actually looking for someone to help me out with a VBA solution as opposed to conditional formatting for this specific instance. Hopefully someone can assist with the VBA solution. Thanks!

  4. #4
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,527

    Re: Create error message when VLOOKUP formula returns specific value

    Hi prodacct,

    Try this event macro on the tab called Worksheet:

    Please Login or Register  to view this content.
    Regards,

    Robert
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  5. #5
    Registered User
    Join Date
    02-09-2015
    Location
    California, United States
    MS-Off Ver
    MS Office 2010
    Posts
    5

    Re: Create error message when VLOOKUP formula returns specific value

    Hi Robert! This code worked perfectly! Is there a way to not have a "Runtime Error 13 mismatch" show up if I delete the info in column 1?

    Thanks so much!!

  6. #6
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,527

    Re: Create error message when VLOOKUP formula returns specific value

    See how this goes:

    Please Login or Register  to view this content.
    Regards,

    Robert

  7. #7
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,527

    Re: Create error message when VLOOKUP formula returns specific value

    See how this goes:

    Please Login or Register  to view this content.
    Regards,

    Robert

  8. #8
    Registered User
    Join Date
    02-09-2015
    Location
    California, United States
    MS-Off Ver
    MS Office 2010
    Posts
    5

    Re: Create error message when VLOOKUP formula returns specific value

    It is perfect! Thanks so much Robert!!!

    SOLVED!

  9. #9
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,527

    Re: Create error message when VLOOKUP formula returns specific value

    It is perfect! Thanks so much Robert!!!

    SOLVED!
    That's great. If you could mark the thread as solved it would be appreciated.

    Regards,

    Robert
    Last edited by Trebor76; 02-11-2015 at 06:59 AM.

+ 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. Replies: 3
    Last Post: 02-09-2015, 11:16 PM
  2. Excel 2007: A Macro created to run Solver returns error message
    By chrys_t in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-22-2014, 08:45 PM
  3. [SOLVED] Vlookup that returns look up if a cell on the same row has a specific value
    By hb316 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-15-2013, 09:33 AM
  4. Replies: 6
    Last Post: 06-11-2013, 08:32 PM
  5. [SOLVED] get cell value if vlookup returns a specific data
    By amar05 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 06-11-2013, 10:57 AM

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