+ Reply to Thread
Results 1 to 9 of 9

VBA help doing data validation

  1. #1
    Registered User
    Join Date
    05-15-2015
    Location
    United States
    MS-Off Ver
    2013
    Posts
    67

    VBA help doing data validation

    Hi -

    I'm looking to see if there is a way to automatically update cells based on a selection. In cell C6 I have 4 options to choose from using data validation. If a selection of EE_only or EE+Child(ren) I would like to have cell C8 go to "N/A". However, cell C8 is also using data validation. Can anyone offer any suggestions?

    Here is the layout
    C6: has the options of EE_Only, EE+Spouse, EE+Child(ren), EE+Family through data validation
    C7: has the option of Yes or no which is through data validation
    C8: has the option of yes or no which is also through data validation. This cell is provided for those selecting EE+Spouse or EE+Family. I'm looking to have this cell update to "N/A" if EE_Only or EE+Child(ren) is selected.

    Any help/suggestions is greatly appreciated.

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: VBA help doing data validation

    In the project browser, double-click on the sheet that you want this behaviour in, and paste the following code:

    Please Login or Register  to view this content.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: VBA help doing data validation

    Additionally, you could also force C8 to be "N/A" even if the user tries to change it to yes or no after selecting one of EE_Only or EE+Child(ren):

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    05-15-2015
    Location
    United States
    MS-Off Ver
    2013
    Posts
    67

    Re: VBA help doing data validation

    Thanks for the help! What is meant by project browser?

  5. #5
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: VBA help doing data validation

    When in excel, press Alt-F11 and that brings you to the macros... on the left you will have a window at the top with sheet1, sheet2, etc and also "ThisWorkbook". That is where you click on the sheet that has the cells you want to change, and paste the code I provided. I guess I should have said Project Explorer not Project Browser.

    Project_Explorer.gif
    Last edited by Arkadi; 08-26-2016 at 12:06 PM.

  6. #6
    Registered User
    Join Date
    05-15-2015
    Location
    United States
    MS-Off Ver
    2013
    Posts
    67

    Re: VBA help doing data validation

    Hi so I pasted the code in "ThisWorkBook", but it doesn't appear to be working. I even went to the sheet listed and pasted, but didn't work. Any suggestions?

  7. #7
    Registered User
    Join Date
    05-15-2015
    Location
    United States
    MS-Off Ver
    2013
    Posts
    67

    Re: VBA help doing data validation

    Got it! Please disregard, and thanks.

  8. #8
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059
    As i said... Not in thisworkbook... Do it on the sheet you are working with

  9. #9
    Registered User
    Join Date
    05-15-2015
    Location
    United States
    MS-Off Ver
    2013
    Posts
    67

    Re: VBA help doing data validation

    Hi Arkadi -

    I was wondering if you can help me add the following to what you have already done? If cell C4 = "Union" than cell C5 and C6 automatically goes to "N/A".
    Last edited by kcgojnur; 08-29-2016 at 04:21 PM.

+ 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. Data validation depending on other data validation without named lists
    By Stormbringer in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-20-2015, 11:24 AM
  3. [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
  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

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