![]() |
and + or
hi all i have a doubt about the syntax of this to be correct..
i want b5+b9 or b5+l9 do i have to use parenthesis around or ?? tyvm If Range("B5") = 1 And Range ("B9") = True Or Range("B5") = 1 And ("L9") = True Then Range("A1") = 'You are lucky! End If |
and + or
Hi
As soon as you are using a combination of And and Or it is better to use () Try If (Range("B5") = 1And Range("B9") = True) Or _ (Range("B5") =1 And Range("L9") = True) Then Range("A1") = 'You are lucky! End If HTH, RadarEye On 22 sep, 13:31, pls123 wrote: hi all i have a doubt about the syntax of this to be correct.. i want b5+b9 or b5+l9 do i have to use parenthesis around or ?? tyvm If *Range("B5") = 1 And Range ("B9") = True * Or * Range("B5") = 1 And ("L9") = True Then Range("A1") = 'You are lucky! End If |
and + or
Yes, you have to!
If (Range("B5") = 1 And Range ("B9") = True) Or (Range("B5") = 1 And ("L9") = True) Then Regards, Stefi €˛pls123€¯ ezt Ć*rta: hi all i have a doubt about the syntax of this to be correct.. i want b5+b9 or b5+l9 do i have to use parenthesis around or ?? tyvm If Range("B5") = 1 And Range ("B9") = True Or Range("B5") = 1 And ("L9") = True Then Range("A1") = 'You are lucky! End If |
and + or
ty!!
"Stefi" wrote: Yes, you have to! If (Range("B5") = 1 And Range ("B9") = True) Or (Range("B5") = 1 And ("L9") = True) Then Regards, Stefi €˛pls123€¯ ezt Ć*rta: hi all i have a doubt about the syntax of this to be correct.. i want b5+b9 or b5+l9 do i have to use parenthesis around or ?? tyvm If Range("B5") = 1 And Range ("B9") = True Or Range("B5") = 1 And ("L9") = True Then Range("A1") = 'You are lucky! End If |
All times are GMT +1. The time now is 09:50 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com