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
Bookmarks