+ Reply to Thread
Results 1 to 9 of 9

Help needed: VBA coding for creating dependent dropdowns based on multiple criteria

  1. #1
    Forum Contributor
    Join Date
    07-27-2018
    Location
    Jodhpur, India
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 Pro 64-bit)
    Posts
    405

    Help needed: VBA coding for creating dependent dropdowns based on multiple criteria

    I require assistance in creating two difficult dropdowns using VBA coding.

    The dropdowns will be created in the A2 and B2 cells of the Sheet 2 worksheet. The B2 dropdown will be dependent on the A2 dropdown value.

    FOR A2 DROPDOWN:

    If the first criteria is met, the A2 value list will include "All", "Zone-7_Jodhpur", and "Zone-7_Pali"

    First Criteria:
    if Sec Dump worksheet's Col S Unique Value (except header row) is exactly matched in count and text both with these values "Matoshree (Phalodi)","Shree Giriraj Ji Agency (Jaisalmer)","Sohan Communication Private Limited (Jodhpur-4)","Vijay Trading Company (Jodhpur-1)","Fair Deal (Jodhpur-3)","Gaurav Marketing (Sirohi)","Dhruv Enterprises (Sanchor)","Global System(Pali)","Maa Kripa Marketing (Barmer)","Adarsh Infratek (Jalore)"

    If the second criteria is met, the A2 value list will include "All", and "Zone-7_Jodhpur"

    Second Criteria (will only work if the first is not met):
    if Sec Dump worksheet's Col S Unique Value (except header row) matches any text from these values "Matoshree (Phalodi)","Shree Giriraj Ji Agency (Jaisalmer)","Sohan Communication Private Limited (Jodhpur-4)","Vijay Trading Company (Jodhpur-1)","Fair Deal (Jodhpur-3)"


    If the third criteria is met, the A2 value list will include "All", and "Zone-7_Pali"

    Third Criteria (will only work if the first and second are not met):
    if Sec Dump worksheet's Col S Unique Value (except header row) matches any text from these values "Gaurav Marketing (Sirohi)","Dhruv Enterprises (Sanchor)","Global System(Pali)","Maa Kripa Marketing (Barmer)","Adarsh Infratek (Jalore)"

    FOR B2 DROPDOWN:
    if A2 selection result is "All" then B2 list will show these values will be automatically fetch all values based on Sec Dump Col S (eg. "All", "Matoshree (Phalodi)","Shree Giriraj Ji Agency (Jaisalmer)","Sohan Communication Private Limited (Jodhpur-4)","Vijay Trading Company (Jodhpur-1)","Fair Deal (Jodhpur-3)","Gaurav Marketing (Sirohi)","Dhruv Enterprises (Sanchor)","Global System(Pali)","Maa Kripa Marketing (Barmer)","Adarsh Infratek (Jalore)") "All" will be added additionally at the top


    if A2 selection result is "Zone-7_Jodhpur" then B2 list will show from these values "Matoshree (Phalodi)","Shree Giriraj Ji Agency (Jaisalmer)","Sohan Communication Private Limited (Jodhpur-4)","Vijay Trading Company (Jodhpur-1)","Fair Deal (Jodhpur-3)" (if any unique value found from these, means if 2 or 3 value find then only those value will be show in B2)) "All" will be added additionally at the top

    if A2 selection result is "Zone-7_Pali" then B2 list will show from these values "Gaurav Marketing (Sirohi)","Dhruv Enterprises (Sanchor)","Global System(Pali)","Maa Kripa Marketing (Barmer)","Adarsh Infratek (Jalore)" (if any unique value found from these, means if 2 or 3 value find then only those value will be show in B2) "All" will be added additionally at the top
    Attached Files Attached Files
    Last edited by Pankaj jaswani; 03-06-2024 at 09:59 AM.

    PJ


    Learning One New Thing Everyday!

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Help needed: VBA coding for creating dependent dropdowns based on multiple criteria

    If I understand this correctly, the current file meets the first criteria so the other criteria need not be considered again UNLESS data is deleted from the file which causes a criteria change.

    It appears a very complex solution rather simply having all selections based on criteria A where B is simply selected on A (as the others are just sub-sets).

    so "Zone-7_Jodhpur" is an extract of "Zone 7" and "Jodpur - n" where n is 1,3,4
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Help needed: VBA coding for creating dependent dropdowns based on multiple criteria

    See attached using Advanced Filter

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

  4. #4
    Forum Contributor
    Join Date
    07-27-2018
    Location
    Jodhpur, India
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 Pro 64-bit)
    Posts
    405

    Re: Help needed: VBA coding for creating dependent dropdowns based on multiple criteria

    @JohnTopley Thank you for your response to this post. You're right that the file I shared as a sample workbook contains all the values that match criteria-1. However, I mentioned different criteria because the data will be split for sharing with different stakeholders, and both dropdown values will be updated accordingly.

  5. #5
    Forum Contributor
    Join Date
    07-27-2018
    Location
    Jodhpur, India
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 Pro 64-bit)
    Posts
    405

    Re: Help needed: VBA coding for creating dependent dropdowns based on multiple criteria

    I have uploaded the format in which I want to apply dropdowns. I have applied two dropdowns on cell O2 and cell P2. The dropdown result in P2 is dependent on the value selected in O2. Currently, these dropdowns are created based on the additional worksheet "Calc," but I do not want to include it when I share the split data with my stakeholders. That is why, I want the Result value in P2 to be automatically updated from the "Sec Dump" sheet (the available value in the sheet).
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Help needed: VBA coding for creating dependent dropdowns based on multiple criteria

    The attached has an updated Data Validation list. "*" is "All", "Jodhpur*" for all "Jodhpur".

    You could limit this list to a stakeholder need and hide/password protect the sheet containing any lists e.g Sheet1.and you could add the "Receiving Agent" as another filter.
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Help needed: VBA coding for creating dependent dropdowns based on multiple criteria

    Hide the "Calc" sheet and password protect it: keep it simple!

  8. #8
    Forum Contributor
    Join Date
    07-27-2018
    Location
    Jodhpur, India
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 Pro 64-bit)
    Posts
    405

    Re: Help needed: VBA coding for creating dependent dropdowns based on multiple criteria

    Indeed, the final option it is

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Help needed: VBA coding for creating dependent dropdowns based on multiple criteria

    If it is, please mark as "SOLVED" ("Thread Tools" at top of page)

+ 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. 3 Multiple dependent dropdowns
    By Ingag in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-25-2022, 04:07 AM
  2. Creating multiple dependent dropdowns
    By arnabnestle in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-22-2021, 06:08 AM
  3. Multi level lookup based on dependent dropdowns.
    By BC3MF in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-12-2021, 05:08 PM
  4. SumIfs function based on multiple dependent Dropdowns
    By mjali001 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-23-2020, 09:19 PM
  5. [SOLVED] Dependent Dropdowns - Multiple words and illegal characters
    By thestatechamp in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 07-06-2017, 01:05 PM
  6. multiple dynamic dependent dropdowns
    By 7WiZARD in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-01-2016, 06:51 AM
  7. Replies: 0
    Last Post: 02-02-2012, 05:38 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