+ Reply to Thread
Results 1 to 7 of 7

Resetting drop-down selection

  1. #1
    Registered User
    Join Date
    02-06-2018
    Location
    UK
    MS-Off Ver
    2016
    Posts
    3

    Resetting drop-down selection

    I currently have the follow formula inside of a dropdown:

    =IF(HasDate="YES",INDIRECT("'DROPDOWN LISTS'!$H$4:$H$"&COUNTA('DROPDOWN LISTS'!$H$4:$H$40)+3),COUNTA('DROPDOWN LISTS'!$H$4:$H$40)+4)

    If the user selects Yes to the HasDate dropdown, a list of dates is shown on a seperate dropdown and if they select no I show a blank dropdown with no selection available. This seems to work fine, the only problem is when The user selects Yes and choices a Date but later on changes HasDate to No, whilst the blankdown is correctly switched to, the previously selected date is still shown.

    Is there a simple way to clear the date from selection under this circumstance.

    Many thanks.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,900

    Re: Resetting drop-down selection

    Best way is with a bit of VBA. Rather than guessing where things are, will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? Please don't attach a picture of one (no-one will want to re-type all your stuff before starting).

    1. Make sure that your sample data are truly REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential information is removed first!!

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    02-06-2018
    Location
    UK
    MS-Off Ver
    2016
    Posts
    3

    Re: Resetting drop-down selection

    Thanks Glenn, no problem I have attached a sample of my project.

    Everything works when Saying Yes to HasDate and selecting a Date. The problem occurs if the person then changes HasDate to No, meaning the Year value is still retained. Is there a way to clear the Year to a Null/Empty value when this happens?

    Please let me know if I can clarify this further.
    Attached Files Attached Files

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,900

    Re: Resetting drop-down selection

    Yes - where are the existing DD boxes???

  5. #5
    Registered User
    Join Date
    02-06-2018
    Location
    UK
    MS-Off Ver
    2016
    Posts
    3

    Re: Resetting drop-down selection

    Sorry Glenn, not sure what happened there but please find the amended file attached.
    Attached Files Attached Files

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,900

    Re: Resetting drop-down selection

    Try this code, pasted onto the worksheet:

    Please Login or Register  to view this content.
    Alt-F11 to see where it's pasted...
    Attached Files Attached Files

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,900

    Re: Resetting drop-down selection

    Scrub that. You may have spotted a fatal flaw....

    Please Login or Register  to view this content.
    Attached Files Attached Files

+ 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. [SOLVED] Resetting drop down selection
    By Engineeronamission in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-10-2014, 07:49 AM
  2. Resetting a column of lists to a default selection
    By annapolisjay in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-30-2014, 01:38 PM
  3. [SOLVED] Newbie - Resetting Cell Values (Drop Down List)
    By thussain in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-24-2014, 06:22 AM
  4. Resetting a drop down menu by selecting another drop down menu
    By Chris07 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-03-2013, 11:57 AM
  5. resetting conditional drop down lists
    By kevinexcel in forum Excel - New Users/Basics
    Replies: 10
    Last Post: 07-22-2010, 11:19 AM
  6. Resetting drop menu's
    By Dreekenkorin in forum Excel General
    Replies: 2
    Last Post: 11-01-2009, 07:39 PM
  7. Resetting Drop down lists
    By jamieb007 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-10-2009, 06:31 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