Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

plusieurs condition pour un If

4 réponses
Avatar
joseph84
Bonjour tout le monde,

je dois mettre plusieurs condition pour un seul resultat est je bute
sur ca.

If Range(Cells(1, 12), Cells(1, 12)) =3D "" And (Range(Cells(1, 13),
Cells(1, 13)) <> "oui" Or (Range(Cells(1, 14), Cells(1, 14)) <>
"REPRISE")) Then
msgbox"Allo"
end if

je comprend pas o=F9 est l'erreur

Merci

4 réponses

Avatar
MichD
Tu pourrais écrire cela en plus simple :

Comme tu n'as pas décrit tes conditions, il est difficile de savoir
si la présentation correspond à tes conditions.

'------------------------------------
If Range("L1") <> "" And _
(LCase(Range("M1")) <> "oui" Or UCase(Range("N1")) <> "REPRISE") Then
MsgBox "Allo"
End If
'------------------------------------


MichD
--------------------------------------------
"joseph84" a écrit dans le message de groupe de discussion :


Bonjour tout le monde,

je dois mettre plusieurs condition pour un seul resultat est je bute
sur ca.

If Range(Cells(1, 12), Cells(1, 12)) = "" And (Range(Cells(1, 13),
Cells(1, 13)) <> "oui" Or (Range(Cells(1, 14), Cells(1, 14)) <>
"REPRISE")) Then
msgbox"Allo"
end if

je comprend pas où est l'erreur

Merci
Avatar
Jacky
Bonjour,

Essaie avec

If (Cells(1, 12) = "" And Cells(1, 13) <> "oui") Or Cells(1, 14) = "REPRISE" Then.....
ou
If ([l1] = "" And [m1] <> "oui") Or [n1] = "REPRISE" Then.....
--
Salutations
JJ


"joseph84" a écrit dans le message de news:

Bonjour tout le monde,

je dois mettre plusieurs condition pour un seul resultat est je bute
sur ca.

If Range(Cells(1, 12), Cells(1, 12)) = "" And (Range(Cells(1, 13),
Cells(1, 13)) <> "oui" Or (Range(Cells(1, 14), Cells(1, 14)) <>
"REPRISE")) Then
msgbox"Allo"
end if

je comprend pas où est l'erreur

Merci
Avatar
joseph84
voila j ai essaye d applique se que tu ma propose mais sa fonctionne
pas il prend pas en charge
les conditions
(LCase(Range("N2")) <> "oui" Or UCase(Range("N2")) <> "REPRISE")

voila le code que j ai utilise et qui ne fonctionne pas:

If (Range("P2") = "" And Range("L2") = "" And Range("M2") = "") And _
(LCase(Range("N2")) <> "oui" Or UCase(Range("N2")) <> "REPRISE")
Then
MsgBox "Allo"
Range("p2").Select
End If

merci
Avatar
joseph84
ok tout fonctionne voila la solution:

If Range("P2") = "" And Range("L2") = "" And Range("M2") = "" And _
(Range("N2") <> "oui" And Range("N2") <> "REPRISE") Then
MsgBox "Allo"
Range("p2").Select
Exit Sub
End If


Merci encore votre aide ;)