+ Reply to Thread
Results 1 to 14 of 14

Dependent Drop Down lists reset

  1. #1
    Registered User
    Join Date
    10-03-2014
    Location
    San Francisco, USA
    MS-Off Ver
    2010
    Posts
    20

    Dependent Drop Down lists reset

    Hey guys,

    I'm new here on the forum, so nice to be part of the family and I hope you guys will be able to help me out! Here is the topic:

    I created a spreadsheet in which I've got 5 drop down lists, all dependent to each other. So depending on what I put in cell J2, solutions are going to pop up in cell K2, then solutions in cell L2 are dependent from J2&K2, etc... until N2 (see attached). Everything has been fine until now (I still have to rename the all matrix in tab 2 though...), but I got stuck when it comes to make this bad boy work a more efficient way.

    In fact, what I would like my spreadsheet to do is to simply reset values in cells K2, L2, M2 and N2 to the first value in the drop down list when I change the value in J2. The point is that then, I can sort my data so the most common value I need is first in the drop down list and appears as soon as I change the value in J2.

    Now I read that thread

    http://www.excelforum.com/excel-prog...ult-value.html

    which is sort of what I need. But I do not know how to adapt the code to my spreadsheet....

    Thanks in advance
    Attached Files Attached Files

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Dependent Drop Down lists reset

    Not sure what the other post said, but I went with:

    Please Login or Register  to view this content.
    I'm pretty VB naive but I can franken-code reasonably well. This code goes directly on the VB project worksheet of Lighting. It activates any time a cell in J2:M499 is changed, and then it blanks out the cell to the right. If that cell isn't in Column M, it cycles around again until it does, effectively blanking out the rest of the row up to M.

    Edit: I read that post just for kicks. ChemistB is a brilliant man. My version is just using a variable targeted range.
    Last edited by daffodil11; 10-07-2014 at 02:30 PM.
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Registered User
    Join Date
    10-03-2014
    Location
    San Francisco, USA
    MS-Off Ver
    2010
    Posts
    20

    Re: Dependent Drop Down lists reset

    Great! thanks for the reply

    Although your answer gets me closer to the solution, it doesn't fix my problem. What I'm trying to do is not to have to select values for columns K, l, M, and N. And have a default value -the first one in each drop down list- every time I select something in the column J.

    Hope this is clear for y'all.

  4. #4
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Dependent Drop Down lists reset

    Ooooo. Perhaps theres a way to pull the first value of the named ranges as default.

    My logic is running towards: WorksheetFunction.Choose(1,Array("named range"))

  5. #5
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Dependent Drop Down lists reset

    Took a while to teach myself the answer, but I finally did it. (Best way to learn, by the way)

    Please Login or Register  to view this content.
    This works for a single column.

    Now let me finish applying it to the rest.

  6. #6
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Dependent Drop Down lists reset

    Almost, just two more cases:

    Please Login or Register  to view this content.

  7. #7
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Dependent Drop Down lists reset

    Going into this I had no clue what Case even was. Glad I got that down now.

    Here's the finished version:

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

  8. #8
    Registered User
    Join Date
    10-03-2014
    Location
    San Francisco, USA
    MS-Off Ver
    2010
    Posts
    20

    Re: Dependent Drop Down lists reset

    Wow... This is working almost perfectly. Really helped out here!!!!

    Thank you a lot

  9. #9
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Dependent Drop Down lists reset

    No problem. Always fun to learn new things.

  10. #10
    Registered User
    Join Date
    10-03-2014
    Location
    San Francisco, USA
    MS-Off Ver
    2010
    Posts
    20

    Re: Dependent Drop Down lists reset

    Hey I'm back! haha

    I might need your help here again for a little modification... I don't know if it is fixable though.

    I've got some drop down lists where I have no data cause well, it does not apply to this specific categories. So let's say I'm picking "Inc" for the lamp type, there is no length and ballast data for it. So excel put a 0 for the length and it kinda screw up the automation (see spreadsheet). Is it possible to adapt the code and make it work so it returns a blank cell instead of a 0?

    thanks in advance
    Attached Files Attached Files

  11. #11
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Dependent Drop Down lists reset

    Sure is! I barely know what I'm doing, but this seems to work:

    Please Login or Register  to view this content.
    There's a second procedure after the formula is entered to check for an error. If it creates one, it just blanks the cell out.
    Attached Files Attached Files
    Last edited by daffodil11; 10-13-2014 at 02:29 PM.

  12. #12
    Registered User
    Join Date
    10-03-2014
    Location
    San Francisco, USA
    MS-Off Ver
    2010
    Posts
    20

    Re: Dependent Drop Down lists reset

    @daffodil11

    Sir I think I got one more problem. My last column (N - "Ballast Option") does not behave the same way as the previous do and updates o #REF! instead of the first choice of my drop down lists. This is I believe only one more line in the code, but I don't want to mess it up.
    Attached Files Attached Files

  13. #13
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Dependent Drop Down lists reset

    Can you show me a combination of the choices that creates an error?

    The workbook you attached did not have the additional code from post #11 in it.

    I've added it into this book.
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    10-03-2014
    Location
    San Francisco, USA
    MS-Off Ver
    2010
    Posts
    20

    Re: Dependent Drop Down lists reset

    Well, when I pick my value in drop down list column J "lamp type", the colomn N "Ballast Option" don't update to thee first value available as column K, L & M do. And also you can see the description doesn't match the type of light I actually pick until I pick the ballast option -I do not know why, I can't figure it out!

+ 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] Reset Drop Lists When Click on first list
    By work4nutz in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-29-2013, 02:43 PM
  2. Dependent drop down lists without creating unique named lists
    By pajordan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-11-2013, 12:20 PM
  3. [SOLVED] Dependent Drop Down Lists, Data Validation, Reset Dependents
    By daxlyon in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-12-2013, 11:15 AM
  4. [SOLVED] Column B drop down list with 2 options, columns C & E with dependent drop down lists
    By betic in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-26-2012, 03:47 PM
  5. [SOLVED] How to Reset Dependent drop downs
    By ertweety in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-18-2012, 06:10 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