+ Reply to Thread
Results 1 to 2 of 2

Two cells must have entries

  1. #1
    Registered User
    Join Date
    04-27-2011
    Location
    Lincoln, NE
    MS-Off Ver
    Excel 2007
    Posts
    2

    Two cells must have entries

    Hello,

    First I want to thank cutter and mrice for helping me with a previous custom data validation challenge. Thanks.

    Now I have another validation challenge. I have a form with locked and unlocked cells on a protected sheet and a protected workbook. This means that usually tabbing will take the user from one unlocked cell to the next unlocked cell.

    Okay, I have two cells that both must either be blank or both have some entry. I would like to alert the user after leaving the second cell (entering some piece of data before they leave the cell) if the first cell is empty and not allowing the user to continue. Such as:

    C1 has a data validation of whole number between 10 and 40.
    D1 has a data validation of whole number between 100 and 400.

    The user finds themselves in C1 and without entering any data tabs to D1 where they input the value of 200. Now, when the user tries to leave the D1, by any method, the validation needs to check if any data is in D1 and if there is checks to see if there is any data in C1. If there is data in both then the focus can move to the next cell, whatever that might be. However, if there is no data in C1 I want an alert telling the user that C1 is blank and needs to have something entered into it.

    Does this make sense? I hope so, because it is driving me nuts.

    Thanks for your help.

    George

  2. #2
    Valued Forum Contributor
    Join Date
    07-17-2005
    Location
    Abergavenny, Wales, UK
    MS-Off Ver
    XL2003, XL2007, XL2010, XL2013, XL2016
    Posts
    608

    Re: Two cells must have entries

    Hi

    You will need some event code on your sheet

    Please Login or Register  to view this content.
    The second sub, you will need to change the value of myRange to the cell the user tabs to after leaving cell D1
    --
    Regards
    Roger Govier
    Microsoft Excel MVP

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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