+ Reply to Thread
Results 1 to 5 of 5

Multiple Data Validation Checks

  1. #1
    Forum Contributor
    Join Date
    10-07-2011
    Location
    Plano, TX USA
    MS-Off Ver
    Excel 2013
    Posts
    141

    Multiple Data Validation Checks

    Hi Everyone -

    I have a situation where I want to check multiple data validations before I allow a user to enter data in a cell.

    I have a row where a user enters in a forecast for an amount that they want to spend. Within that row, I have a column for "Finance Approval". The approval cell uses a simple pull-down data validation list with "Approved", "Rejected". I also have another cell where I store the value of the user's "rights" based upon their login ID. So, an approved "Finance Approver" has his rights set to "Finance" when he logs in.

    What I want to do is have a combined validation where only someone with the "Finance" rights can make changes to the "Finance Approval" column. If a use attempts to make a change to the restricted cell that does not have the proper rights, then use a Msgbox to inform the user that the dont have rights. Otherwise, they will see the pull-down list.

    I'm posting this thread in the Programming Group because I'm not sure that it can be done simply using Data Validation.

    What I would rather use a VBA solution that checks to see if a user has required rights to make a change to the cell, something like a "Before the Value of the Cell is Changed" approach. Then, if they have changed the cell value without the required rights, I can pop up a box "You do not have rights to modify this Cell Contents" and leave the cell value at it's previous value.

    I hope all this makes sense and somebody can help me with this.

    Thanks in advance!

    Jim

  2. #2
    Valued Forum Contributor Steffen Thomsen's Avatar
    Join Date
    10-15-2010
    Location
    Kolding, Denmark
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    953

    Re: Multiple Data Validation Checks

    Hi,

    You could restrict it like this

    Please Login or Register  to view this content.
    Please take time to read the forum rules

  3. #3
    Forum Contributor
    Join Date
    10-07-2011
    Location
    Plano, TX USA
    MS-Off Ver
    Excel 2013
    Posts
    141

    Re: Multiple Data Validation Checks

    Thanks Steffen.
    I thought of doing that and it will work but isn't it "after the fact"? The user has already made a change. How do I put the changed value back to it's original (previous) value after the pop up message?

    Is there a way to check before the value is changed? If not, I can use your solution but still nedd to know how to restore the previous value.


    Please Login or Register  to view this content.
    Jim
    Last edited by stubbsj; 07-01-2012 at 01:19 PM. Reason: add additional information

  4. #4
    Valued Forum Contributor Steffen Thomsen's Avatar
    Join Date
    10-15-2010
    Location
    Kolding, Denmark
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    953

    Re: Multiple Data Validation Checks

    No this happen when a selection of a cell is made

    Private sub Worksheet_SelectionChange(byval target as range)

    The event your thinkin about is this one, this fires when a cell value changes.

    Private sub Worksheet_Change(byval target as range)

  5. #5
    Forum Contributor
    Join Date
    10-07-2011
    Location
    Plano, TX USA
    MS-Off Ver
    Excel 2013
    Posts
    141

    Re: Multiple Data Validation Checks

    Right you are Steffen. Thanks for the clarification. My brain is running on Empty today.

    I'm going to mark this as solved.

    Thanks again,
    Jim

+ 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