+ Reply to Thread
Results 1 to 3 of 3

IF THEN ELSE based on Three Dependent Drop Down Lists (VBA)

  1. #1
    Registered User
    Join Date
    03-14-2012
    Location
    Richmond, VA
    MS-Off Ver
    Excel 2007
    Posts
    10

    IF THEN ELSE based on Three Dependent Drop Down Lists (VBA)

    Hello All,

    I'm hoping that one of you kind ladies or gentlemen can help me with a problem I'm having with my VBA code. I would like my IF statement to take the choices made in three dependent drop down lists that I have in my workbook and return a value based on the aforementioned choices. As an esxample if "PLX" is choosen in drop down 1 and "Imaging_TopCall" is choosen in drop down 2 and "Missing From File" is choosen in drop down three then "Level 1" is auto populated in the Preliminary Risk column. All three choices have to match exactly. I have tried to accomplish this functionality by using VLOOKUP, INDEX and Match, Case Select, and a wealth of other alternatives but none seem to work the way I would like. All of the drop down lists and the range of cells that will recieve the value from the code have been named. Also, there is other code in the same worksheet module that uses the same sub i.e Private Sub Worksheet_Change(ByVal Target As Range). This may be my problem, or it may be an issue with my code logic itself. Any help you guys can give me would be of great help. Thanks guys!!



    Here is a sample of my code:


    Private Sub Worksheet_Change(ByVal Target As Range)

    If cboDefCat.Value = "PLX" And cboDefType.Value = "Imaging_TopCall" And cboDefDetail.Value = "Missing From File" Then

    PrelimRisk.Value = "Level 1"

    ElseIf cboDefCat.Value = "Document" And cboDefType.Value = "Assignment" And cboDefDetail.Value = "Not Needed" Then

    PrelimRisk.Value = "Level 2"

    ElseIf cboDefCat.Value = "Document" And cboDefType.Value = "Assignment" And cboDefDetail.Value = "Incorrect Investor" Then

    PrelimRisk.Value = "Level 1"

    ElseIf cboDefCat.Value = "PLX" And cboDefType.Value = "Inadequate Research" And cboDefDetail.Value = "Research Not Followed" Then

    PrelimRisk.Value = "Level 1"

    ElseIf cboDefCat.Value = "Document" And cboDefType.Value = "Assignment" And cboDeDetail.Value = "Data Integrity Error" Then

    PrelimRisk.Value = "Level 1"

    End If

    End Sub

  2. #2
    Valued Forum Contributor
    Join Date
    02-04-2009
    Location
    Texas
    MS-Off Ver
    Excel 2016
    Posts
    665

    Re: IF THEN ELSE based on Three Dependent Drop Down Lists (VBA)

    I am pretty new to VBA - but I used something like this:
    Please Login or Register  to view this content.
    This should set up cascading Combo Boxes to get to final value

  3. #3
    Registered User
    Join Date
    03-14-2012
    Location
    Richmond, VA
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: IF THEN ELSE based on Three Dependent Drop Down Lists (VBA)

    Thanks for your response man! I think the example you provided sets up a dependent drop down list structure, but I have already added this functionality to my project. What I'm looking for is a way to take the choices i make in my dependent drop down lists and have a cell in my workbook populate with a value based on those choices. Thanks again for your effort man. It is greatly appreciated.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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