If Application.countif([A1:A3],"Sophie*") =3 then
end if
If [A1]="Sophie" And [A2]="Sophie" And [A3]="Sophie" Then
End if
If Range("A1").Value = "pomme" Then
If Range("B1").Value = "poire" Then
If Range("C1").Value = "fraise" Then
If Range("D1").Value = "cerise" Then
MsgBox "ca marche"
End If
End If
End If
Else
MsgBox "pas bon"
End If
If Range("A1").Value = "pomme" And Range("B1").Value = "poire" And _
Range("C1").Value = "fraise" And Range("D1").Value = "cerise" Then
MsgBox "ok"
Else
MsgBox "non ok"
End If
[COLOR=BLUE]Private Sub[/COLOR] CommandButton1_Click()
[COLOR=BLUE]If[/COLOR] Range("A1").Value = "pomme" [COLOR=BLUE]Then[/COLOR] Var = 1
[COLOR=BLUE]If[/COLOR] Range("B1").Value = "poire" [COLOR=BLUE]Then[/COLOR] Var = Var + 1
[COLOR=BLUE]If[/COLOR] Range("C1").Value = "fraise" [COLOR=BLUE]Then[/COLOR] Var = Var + 1
[COLOR=BLUE]If[/COLOR] Range("D1").Value = "cerise" [COLOR=BLUE]Then[/COLOR] Var = Var + 1
Message = IIf(Var = 4, "Ca Marche", "Ca marche pas")
MsgBox Message
[COLOR=BLUE]End Sub[/COLOR]
MsgBox IIf(Range("A1").Value = "pomme" And Range("B1").Value = "poire" And Range("C1").Value = "fraise" AndRange("D1").Value = "cerise", "ca marche", "pas bon")
[COLOR=blue]Sub[/COLOR] Sophie2()
Liste = "pommepoirefraisecerise"
Var = Range("A1").Value & Range("B1").Value & Range("C1").Value & Range("D1").Value
MsgBox IIf(InStr(Liste, Var) = 1, "Ca Marche", "Ca Marche pas")
[COLOR=blue]End Sub[/COLOR]
Sub Est()
MsgBox IIf(([A1] = "pomme") + ([B1] = "poire") + ([C1] = "fraise") + ([D1] = "cerise") = -4, "ok", "oups")
End Sub