I am creating 2 combo boxes in a userform. I want the content of combo2 to change depending on the value selected in combobox1. I tried this but regardless of what i select in combox1, all 4 show up in combobox2.
Sub eiCombo()
With cboAction
.AddItem "Email"
.AddItem "Search"
.AddItem "Call"
.AddItem "To Do"
End With
cboAction.Value = ""
If cboAction.Value = "Email" Then
With cboContent
.AddItem "access"
.AddItem "excel"
End With
Else cboAction.Value = "Search" then
With cboContent
.AddItem "FrontPage"
.AddItem "powerpoint"
End With
End If
End Sub
Sub eiCombo()
With cboAction
.AddItem "Email"
.AddItem "Search"
.AddItem "Call"
.AddItem "To Do"
End With
cboAction.Value = ""
If cboAction.Value = "Email" Then
With cboContent
.AddItem "access"
.AddItem "excel"
End With
Else cboAction.Value = "Search" then
With cboContent
.AddItem "FrontPage"
.AddItem "powerpoint"
End With
End If
End Sub