Je me pose une question pour réaliser cette multiple condition en fonction VBA
Si A1= sophie1 ET si A2=sophie2 ET si A3=sophie3
alors MsgBox "Sophie Vrai"
sinon MsgBox "Sophie Faux"
Salut sophie11,
sub sophie
if range("a1").value = "SOPHIE1" then
if range("a2").value = "SOPHIE2" then
if range("a").value = "SOPHIE3" then
msgbox "Sophie Vrai"
end if
end if
else
msgbox "Sophie Faux"
end sub
Suerte
croco
J'ai un souci avec mon code, pourtant j'ai bien repris vos exemples :
Je veux que SI A1=pomme ET B1=poire ET C1=fraise ET D1=cerise ; alors si tout ça est vrai on a msgbox "ca marche", si une des valeurs est fausse alors msgbox "pas bon".
Ce code ne marche pas lorsque tout est vrai, et quand B1, C1, D1 n'a pas la bonne valeur rien ne se passe..
Code:
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