+ Reply to Thread
Results 1 to 6 of 6

VBA Data Validation

  1. #1
    Registered User
    Join Date
    04-11-2013
    Location
    Bath, England
    MS-Off Ver
    Excel 2010
    Posts
    27

    VBA Data Validation

    Hi,

    I'm trying to build some data validation into attached table. The sheet will be locked down except for the two orange columns where the user will have to record either a % in column D or a whole value in column E. I already have data validation on these cells to allow only of these cells to be completed per row.

    I need some form of additional validation that will only allow the value in column to be more than 10% of column C if column B has a value. If column B is blank, the calculation in column F must be less than 10%. To make things a little more complicated, Column B has a VLOOKUP formula in it, so won't be truly blank.

    Is this possible?
    Attached Files Attached Files

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

    Re: VBA Data Validation

    It is certainly possible though there is one important question.

    "...only allow the value in column to be more than...." I think you left out what column you were referring to here. Is this restriction on F or G?

    By the way, your existing data validation formula works, but for the wrong reason. A data validation custom formula should state a condition that is required to be TRUE. I can't figure out how you wrote yours, but it is more like a formula that would be found in a cell. I would use this formula instead in both columns D and E:

    =COUNTA(D2:E2)<2

    I would also provide guidance to the user in case of error so they know what they did wrong.
    Last edited by 6StringJazzer; 03-27-2017 at 01:08 PM.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,756

    Re: VBA Data Validation

    If you meant column F, then your validation formula only has to consider column D. Update the data validation formula in D2 to be

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    and copy down.

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,756

    Re: VBA Data Validation

    Oh, by the way, no VBA required.

  5. #5
    Registered User
    Join Date
    04-11-2013
    Location
    Bath, England
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: VBA Data Validation

    Thanks so much, that works perfectly and easier than VBA!

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,756

    Re: VBA Data Validation

    Glad to help, and thanks for the rep! I have marked the thread solved for you.

    Next time, go to the menu immediately above your first post to the thread and click on Thread Tools. From the dropdown menu select "Mark this thread as solved..."

+ 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: 06-04-2015, 02:27 PM
  2. [SOLVED] Data Validation: How to clear/delete the content of the cell and not Data Validation List?
    By lukelucky in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-07-2015, 09:42 AM
  3. If statement based data validation? Dynamic data validation?
    By bjohnsonac in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-02-2014, 02:12 PM
  4. Replies: 4
    Last Post: 07-03-2014, 02:37 AM
  5. Replies: 4
    Last Post: 12-19-2013, 10:44 AM
  6. Adding Date Data Validation to cells with List Data Validation
    By biggtyme in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-03-2013, 09:47 AM
  7. Using Defined Names with Data Validation Depend and Data Validation Multi Select
    By Vinnie Chan in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-01-2012, 05:36 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