lundi 28 décembre 2015

Multiple If conditions in Excel

I clearly have a syntax issue and would like to know where am I magically missing the point. Got tired of trying to find the answer so I decided to ask.

Code just wants to check if X is not any of three specific variables, and if not then P = 3, other P will equal 1 or 2 based on a combo box result.

I tried using Or statements with this and no luck.

 If X <> 15 Then
     P = "3"
 Else
     If X <> 18 Then
         P = "3"
     End If
         Else
             If X <> 20 Then
                 P = "3"
             End If
 ElseIf ComboBox <> "Other Condition" Then
     P = 1
     Else: P = 2
 End If

Aucun commentaire:

Enregistrer un commentaire