+ Reply to Thread
Results 1 to 4 of 4

VBA Data Validation Question

  1. #1
    Forum Contributor
    Join Date
    01-30-2011
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    102

    VBA Data Validation Question

    I have a range of cells from Q17:Q167 where I need data validation to change around based on values in the range E17:E167. If column E contains an asterisk, then the cell on the same row in column Q should be validated with the dynamic range named "title1". Since the values in col E change (upon a button click), the same row will not always have the asterisk, therefore validation should be deleted from the cells that don't have an asterisk in Col E. I can't seem to wrap my head around how to solve this without involving conditional formatting, which would prevent the drop down from being used, but the drop down exists, and would be confusing to users wondering why there is a drop down in a cell where there shouldn't be.

    I hope that makes sense. It's not possible to load an example of the spreadsheet as it is quite large and contains sensitive information, but I include a basic idea of what I'm after.

    row# Col E Col Q

    17 * validation
    18 * validation
    19 fsdfsf no validation
    20 * validation

    after a button click the information changes

    row# Col E Col Q
    17 dfsdfsd no validation
    18 * validation
    19 * validation
    20 dfsdfsfs no validation

    Thanks for looking!
    Last edited by ZooTV92; 06-20-2016 at 12:36 AM.

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: VBA Data Validation Question

    You live and you learn. I never knew that the range validation for a list validation could take an if statement.
    =IF($E2="*",Title1,FALSE)

    See the attached. You'll have to change the cell references to match you setup.
    Attached Files Attached Files
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Forum Contributor
    Join Date
    01-30-2011
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    102

    Re: VBA Data Validation Question

    I actually got that far. The issue is that the cells without the corresponding asterisk still have the drop down menu, even though it's "deactivated". I was hoping there would be a way that for those cells there would be no validation at all, meaning no drop down menu if you were to click on the cell....That's why I was trying to steer away from conditional formatting, and stick with VBA, if it's even possible.....

  4. #4
    Forum Contributor
    Join Date
    01-30-2011
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    102

    Re: VBA Data Validation Question

    Finally figured it out.

    Please Login or Register  to view this content.

+ 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. Data Validation question
    By Steven811 in forum Excel General
    Replies: 7
    Last Post: 03-21-2016, 08:57 AM
  2. Data Validation Question
    By dubs1013 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-20-2015, 05:54 PM
  3. Data Validation question
    By TDFEELY in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-24-2012, 11:28 AM
  4. Data Validation Question
    By Bizquick in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-05-2011, 12:12 PM
  5. Data Validation - question
    By tweek333 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-29-2009, 11:59 AM
  6. Excel 2007 : Data Validation Question
    By jasonmcbride in forum Excel General
    Replies: 6
    Last Post: 10-29-2008, 06:13 PM
  7. [SOLVED] Another Data Validation question
    By Nigel in forum Excel General
    Replies: 3
    Last Post: 10-14-2005, 06:05 PM

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