Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Dependent Drop Down Lists

  1. #1
    Member
    Join Date
    Jun 2012
    Posts
    80
    Rep Power
    13

    Dependent Drop Down Lists

    Hi All,

    I am preparing an Appraisal file for my company. Wherein, I would like to have drop down lists based on the cell values of the previous cells.

    Appraisal - Drop Down.xlsx

    The 'Appraisal' sheet is where I would like to have all the drop down lists.

    Requirements:

    1. Under "Social Competencies", the drop down list should contain all the headers from the sheet "Comments" (Color Code - Peach).

    2. Under "Please Choose", the drop down list should contain "Does Not Meet Expectation", "Meets Expectation", "Exceeds Expectation" (Color Code - Grey).

    3. So, If a person selects "Communicating Effectively" under Social Competencies column, and then selects "Meets Expectation" in the next column, then the drop down list on Column D "Please Choose" should display the list from B3:B8 from the sheet named "Comments".

    Another example would be if a person selects "Resolving Conflict" under Social Competencies column, and then selects "Does Not Meet Expectation" in the next column, then the drop down list on Column D "Please Choose" should display the list from A13:A18 from the sheet named "Comments".

    4. So, If a person selects "Sharing Information" under Social Competencies column, then the drop down list on Column E "Give Advise" should display the list from A28:A32 from the sheet named "Give Advise"


    Would highly appreciate it if some one could really guide me through the process of Data Validation for the above-mentioned exercise.


    Regards,
    Siyab

  2. #2
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,521
    Rep Power
    10
    Hello Siyab,
    Your requirement seems to be split into 2 parts:
    Drop Down Lists _1. _2.
    and
    Dependent Drop Down Lists_3. _4.

    I assume you have little knowledge of drop downs in Excel, since the first 2 parts of your question _1. And _2. are very fundamental basic Excel Drop down list stuff.
    I have almost no knowledge of such things, so my start point would likely be an internet ( google ) search:
    https://www.google.com/search?q=how%...t%20in%20excel
    https://www.google.com/search?q=how ... list in excel

    There is a vast amount of information and tutorials, even in different languages:
    https://www.google.com/search?q=how ...xcel in Arabic
    https://www.google.com/search?q=how ...excel in Hindi


    I followed some of the tutorials. I also let the macro recorder run whilst doing some exercises, to see if coding could help us. Here some extra notes I made : https://excelfox.com/forum/showthrea...ll=1#post15077




    I will answer your question in two parts.
    First we will do the basic stuff…..
    Drop Down Lists
    _1. Under "Social Competencies", the drop down list should contain all the headers from the sheet "Comments" (Color Code - Peach).
    _ 2. Under "Please Choose", the drop down list should contain "Does Not Meet Expectation", "Meets Expectation", "Exceeds Expectation" (Color Code - Grey).


    Data Validation – Drop down lists
    It would appear that Drop down lists are part of , or have evolved from, a more complex subject, that subject being “Data Validation
    For our purposes, the significance of this is only that we will often come cross the word “validation” and associated words a lot.

    Under "Social Competencies", the drop down list should contain all the headers from the sheet "Comments"
    "Under “Please Choose", the drop down list should contain "Does Not Meet Expectation", "Meets Expectation", "Exceeds Expectation"

    Manually:
    I followed the information available on the internet, and initially manually made those two drop down lists, as in the uploaded file, Appraisal - Drop Down.xls

    Using VBA coding:
    Alternative to manually, we can make those drop down lists using VBA
    https://excelfox.com/forum/showthrea...ll=1#post15083
    Example: create drop down lists using VBA
    Code:
    Sub MakeFirstTwoDropDowns2()  '     https://excelfox.com/forum/showthread.php/2676-Dependent-Drop-Down-Lists?p=15071#post15071
    Rem 1 worksheets info
    Dim WsApp As Worksheet, WsComs As Worksheet
     Set WsApp = ThisWorkbook.Worksheets("Appraisal"): Set WsComs = ThisWorkbook.Worksheets("Comments")
    Rem 2 FirstTwoDropDowns2
     WsApp.Range("A2:A8").Validation.Delete
     'WsApp.Range("A2:A8").Validation.Add Type:=xlValidateList, Formula1:="Communicating Effectively,Resolving Conflict,Sharing Information,Supporting Co - workers"
     WsApp.Range("A2:A8").Validation.Add Type:=xlValidateList, Formula1:="" & WsComs.Range("A1").Value & "," & WsComs.Range("A11").Value & "," & WsComs.Range("A21").Value & "," & WsComs.Range("A31").Value & ""
    
     WsComs.Range("C2:C8").Validation.Delete
     'WsComs.Range("C2:C8").Validation.Add Type:=xlValidateList, Formula1:="Does Not Meet Expectation,Meets Expectation,Exceeds Expectation"
     WsComs.Range("C2:C8").Validation.Add Type:=xlValidateList, Formula1:="" & WsComs.Range("A2").Value & "," & WsComs.Range("B2").Value & "," & WsComs.Range("C2").Value & ""
    End Sub
    









    Dependent Drop Down Lists

    _3. If a person selects "Communicating Effectively" under Social Competencies column, and then selects "Meets Expectation" in the next column, then the drop down list on Column D "Please Choose" should display the list from B3:B8 from the sheet named "Comments".
    Another example would be if a person selects "Resolving Conflict" under Social Competencies column, and then selects "Does Not Meet Expectation" in the next column, then the drop down list on Column D "Please Choose" should display the list from A13:A18 from the sheet named "Comments".
    _4. If a person selects "Sharing Information" under Social Competencies column, then the drop down list on Column E "Give Advise" should display the list from A28:A32 from the sheet named "Give Advise"



    One way to do this would be to use event coding which triggers macros similar to those discussed above which will create the required drop down lists.
    ( A recent thread example is here: https://excelfox.com/forum/showthrea...nditions/page2 )

    I suggest, Siyab, that you study
    _ what I have done for you so far, for _1. And _2.
    _ this thread: https://excelfox.com/forum/showthrea...nditions/page2

    See if you can make a start yourself on _3. And _4

    I will look again in a day or two to see if you need further help.




    This would be my initial idea…….

    Second part: Dependant drop down list.

    The contents of the third and forth drop down lists ( in column D and E in worksheet Appraisals ) are dependant on the selection in the first two drop downs list . ( in column A and C ).

    One way to tackle this is to re create the drop down lists using VBA for column C and column D every time a value is changed in column A or column B
    We have seen in the previous posts how to create a drop down list using VBA .
    So all we need is similar coding, but which is triggered by a worksheets change event





    Alan
    Attached Files Attached Files
    Last edited by DocAElstein; 11-07-2020 at 03:24 PM.

  3. #3
    Member
    Join Date
    Jun 2012
    Posts
    80
    Rep Power
    13
    Hi Alan,

    Thank you for your assistance.

    I had an idea on how to create drop downs 1 & 2. The only reason i did not mention about it in my post was because i thought dependent lists worked differently. So I thought it was better to get help from drop down 1 itself.

    Drop down 3 & 4 are very tricky and is out of my league and understanding. Hopefully you can guide me through with it.

  4. #4
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,521
    Rep Power
    10
    Hello Siyab,
    Quote Originally Posted by msiyab View Post
    ...... i thought dependent lists worked differently. So I thought it was better to get help from drop down 1 itself.
    Drop down 3 & 4 are very tricky and is out of my league and understanding. Hopefully you can guide me through with it.
    I expect your thinking is not necessarily incorrect: I would expect that there is an efficient way to look at this problem considering all 4 list together.
    But I don’t know how to do it that way. I only have limited basic VBA knowledge.

    So my strategy is to treat all 4 lists as independent lists created in the same way using VBA
    List 1 and 2 can be either made once, or assumed to have been made.
    So we will leave them made for now. Or if you start with Worksheet Appraisals having no drop down lists, then you would use this macro to make just lists 1 and 2: https://excelfox.com/forum/showthrea...ll=1#post15073


    The solution I am proposing is not difficult, and is possibly not the most efficient.

    Drop down List 3 and 4 will be remade / recreated by VBA coding , every time a different selection is made from drop down list 1 or 2.
    When a different selection is made from list 1 or 2 , then that results in the cell to which they are associated changing its value. As far as VBA is concerned , it sees a cell change. ( VBA does not recognise you using the drop down list itself, but it does detect the cell value change).

    We can use “Event coding” to detect a cell change. This can be used to trigger the re creating of the Lists 3 and 4.

    We need to access the worksheet code module for worksheet Appraisals , and one of the available event codings, which is always there, but empty with no coding in it.
    https://imgur.com/rteyeHM https://i.imgur.com/rteyeHM.jpg -- select the worksheet code module
    https://imgur.com/ex9FlRI https://i.imgur.com/ex9FlRI.jpg -- select worksheets event codings
    https://imgur.com/ZjEw5xy https://i.imgur.com/ZjEw5xy.jpg - - - we want the Worksheet_Change( ) macro



    We must add coding to it, ( put coding inside it ) , for example, I have made a start for you here: https://excelfox.com/forum/showthrea...ll=1#post15087




    Summary of coding: ( Private Sub Worksheet_Change(ByVal Target As Range) -----
    https://excelfox.com/forum/showthrea...ll=1#post15087
    )
    Rem 1
    We usually restrict most of the macro workings to only be done when specific ranges are chosen. In our case those ranges are column A and C from row 2 to row 8

    Rem 2
    In this section we go through the combinations of SOCIAL COMPETENCIES and Please Choose, and then create the appropriate drop down lists 3 and 4

    ‘2a) Communicating effectively
    _... ‘2a(i) Does Not Meet Expectation
    _... ‘2a(ii) Meets Expectation
    _... ‘2a(iii) Exceeds Expectation

    ‘2b) Resolving Conflict
    _... ‘2b(i) Does Not Meet Expectation
    _... ‘2b(ii) Meets Expectation
    _... ‘2b(iii) Exceeds Expectation

    ‘2c) Sharing Information
    _... ‘2c(i) Does Not Meet Expectation
    _... ‘2c(ii) Meets Expectation
    _... ‘2c(iii) Exceeds Expectation

    ‘2d) Supporting Co-workers
    _... ‘2d(i) Does Not Meet Expectation
    _... ‘2d(ii) Meets Expectation
    _... ‘2d(iii) Exceeds Expectation




    So I made a start for you.
    If you study the coding and get some understanding of it, then I think you can complete the macro

    I will look in again in a day or two to see if you need more help



    Alan
    Attached Files Attached Files
    Last edited by DocAElstein; 11-08-2020 at 05:44 PM.

  5. #5
    Member
    Join Date
    Jun 2012
    Posts
    80
    Rep Power
    13
    Quote Originally Posted by DocAElstein View Post
    So I made a start for you.
    If you study the coding and get some understanding of it, then I think you can complete the macro

    I will look in again in a day or two to see if you need more help

    Alan
    Hi Alan,

    I tried to complete the code under Rem 2, but something has gone wrong. the drop downs do not work. Sorry my VBA knowledge is close to Zero. Please have a look at it whenever its possible.

    Appraisal - Drop Down (VBA).xls

  6. #6
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,521
    Rep Power
    10
    Hello Siyab,
    Your attempt ( https://excelfox.com/forum/showthrea...ll=1#post15091 ) , looks to me, at first glance, to be ( almost *** ) perfectly correct!.
    I have not checked every detail, but it appears, at first glance , as if you have done everything exactly as I was suggesting.

    Furthermore , the macro appears to work when I try it.

    So I am not sure what the problem is. I can see no problem.

    Your macro version is working as I expect. Your macro version appears to me to work perfectly:
    If I make any changes in a row in ranges A2:A8 or C2:C8 in worksheet Appraisals, then the macro makes the drop down lists in that same row in columns D and E in worksheets Appraisals. Any newly made drop down lists, appear to work normally.




    Possibly, I have misunderstood what you want.

    If you continue to have problems then :-
    Explain carefully, an example that you try that does not work.

    Tell me exactly what you do, and what results you are expecting. Tell me what does or does not happen








    almost ***
    ***[size=1] ( There were just some very minor typos in the comment notation '2a
    Last edited by DocAElstein; 11-09-2020 at 05:49 PM.

  7. #7
    Member
    Join Date
    Jun 2012
    Posts
    80
    Rep Power
    13
    Hi,

    Sorry, i managed to get the file to work after saving it as "Macro-Enabled". Silly me.

    But now the trouble is bigger. What i thought would have been a simple macro or some Data Validation tweaks has turned out be a nightmare (for me).

    I initially shared just one Topic/Header to find out the solution to my drop down list. But in actual i have 4 Topics which have more selections under each topic. I thought I could easily replicate the solution provided to the other topics.


    I have attached the file, with the actual template of my file.

    Appraisal - Drop Down (VBA).xlsm

    As you can see, Cell A25, A28, A31 & A34 are the Topics, under which the drop down items change. I feel it would be a real tedious task to integrate the macro in the attached format. I have done the write-up for all topics in Comments & Advise sheets, as per the previous file.

    Will it be too complicated?

  8. #8
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,521
    Rep Power
    10
    Hi Siyab
    - Sorry, I don’t understand anything in your last post

    I have no idea what it is that you are talking about.

    Try again to explain carefully, what it is that you are trying to do, or wanting to do.
    Take your time to explain carefully , possibly with an example.
    Walk me carefully through an example , tell me exactly what you do and what you want to happen as a result of that.

    I can’t respond or reply quickly, so take your time, and try not to miss out any details.

    Alan

  9. #9
    Member
    Join Date
    Jun 2012
    Posts
    80
    Rep Power
    13
    Alright, let me try to explain everything from the beginning.

    The sheet named "Actual Appraisal Form" is where I want the drop down to be placed (Row 25 to 36 to be precise).

    Cell A25, A28, A31 & A34 are the categories under which each employee will be evaluated. Lets call them as "Topics" from now on. They are highlighted in Grey.


    Under each Topic , there are sub points, For example, in the sheet "Comments", Column D shows the Topics and Column E shows the sub points.

    1) Now what is required is that I need a drop down menu under Cell A25 (Social Competencies) which shows the sub points in Column E of the "Comments" sheet.

    2) 2nd drop down will be under cell C26. Which will contain 3 common items (i.e., 'Does Not Meet Expectations', 'Meets Expectations', 'Exceeds Expectations')

    3) Based on the previous 2 cells' (A26 & C26) selection, If a person selects "Communicating Effectively" under Social Competencies column, and then selects "Meets Expectation" in the next column, then the drop down list on Column C "Please Choose" should display the list from B3:B8 from the sheet named "Comments".

    Another example would be if a person selects "Resolving Conflict" under Social Competencies column, and then selects "Does Not Meet Expectation" in the next column, then the drop down list on Column D "Please Choose" should display the list from A13:A18 from the sheet named "Comments". In the Comments sheet, you can see subtopics highlighted in peach color, and right next to it is the Topic mentioned just for your reference.

    4) So, If a person selects "Sharing Information" subtopic under Social Competencies column, then the drop down list on Column E "Give Advise" should display the list from A28:A32 from the sheet named "Give Advise". In the Advise sheet, you can see subtopics highlighted in peach color, and right next to it is the Topic mentioned just for your reference.

    Please do let me know if my explanation was clear this time.

  10. #10
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,521
    Rep Power
    10
    OK, I think I understand now.
    In your last post, post #9, you gave basically the same explanation as in your very first post, post #1,
    The small difference is that instead of a range A1:E8 we now have a range A25:G27
    So you already have the coding for that, you just need to change the ranges appropriately

    The coding would take this sort of form….

    _____ If Application.Intersect(Target, Me.Range("A26:A27,C26:C27")) Is Nothing Then
    ‘ code like before with ranges adjusted appropriately



    Now I see we basically have 3 extra ranges. In other words, we are really just doing the same thing again another 3 times




    Quote Originally Posted by msiyab View Post
    Will it be too complicated?
    I don’t think it is particularly complicated. In basic terms you are doing the same thing again 4 times instead of 1 time.
    There is no real new complications:
    So you did it once, and can do it again ( and again and again and again !!! )

    Quote Originally Posted by msiyab View Post
    ... I feel it would be a real tedious task...
    I suppose writing coding is always a bit tedious.
    It is not too bad in your particular requirement because we have a lot of very similar coding. We can do a lot of copying ( Ctrl+c ) and pasting ( Ctrl+v ) . After that you need to make minor changes to ranges.




    There are two basic ways that I see to do this

    Way 1

    The macro would look basically like this , and be approximately 4 times as long as previously:
    _____ If Application.Intersect(Target, Me.Range("A26:A27,C26:C27")) Is Nothing Then
    ‘ code like before with ranges adjusted appropriately


    _____ If Application.Intersect(Target, Me.Range("A29:A30,C29:C30")) Is Nothing Then
    ‘ code like before with ranges adjusted appropriately


    _____ If Application.Intersect(Target, Me.Range("A32:A33,C32:C33")) Is Nothing Then
    ‘ code like before with ranges adjusted appropriately


    _____ If Application.Intersect(Target, Me.Range("A35:A36,C35:C36")) Is Nothing Then
    ‘ code like before with ranges adjusted appropriately



    Way 2

    This might require you to slightly reorganise your Advise data so that different sections are at similar offsets to each other

    We would then have a macro very similar to the previous starting something like this

    _____ If Application.Intersect(Target, Me.Range("A26:A27,C26:C27, A29:A30,C29:C30, A32:A33,C32:C33, A35:A36,C35:C36")) Is Nothing Then
    ‘ code like before with ranges determined by an offset. This offset will vary according to which of the 4 main ranges were selected


    Way 2 would be a shorter code, but would take a bit more brain work to figure out the logic


    I expect if I was in your position, I would do it in Way 1. There are no real advantages of Way 2
    There are no problems with having a macro 4 times as long as the previous one, and you don’t need to type it all,
    since you can get most of it by copying ( Ctrl+c ) and pasting ( Ctrl+v ) what you already have.





    I am not sure how I can help further?

    Tell me if you want me to make a start for you as I did before.


    Alan
    Last edited by DocAElstein; 11-12-2020 at 04:05 PM.

Similar Threads

  1. Dynamic Dependent Dropdown List Filter
    By william516 in forum Excel Help
    Replies: 2
    Last Post: 07-09-2013, 09:21 PM
  2. Replies: 7
    Last Post: 04-22-2013, 01:41 PM
  3. dropdown lists in headings by using Filter
    By Dane in forum Excel Help
    Replies: 3
    Last Post: 01-24-2013, 11:08 PM
  4. Dependent Data Validation (Using Only Formulas)
    By Admin in forum Download Center
    Replies: 2
    Last Post: 10-18-2011, 03:14 PM
  5. Data Validation Dependent Dropdowns
    By Admin in forum Download Center
    Replies: 0
    Last Post: 04-10-2011, 03:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •