Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem with logical sentence
i have this conditional sentence
If Cells(NumFilas, 2).Value < "NAFF" Or Cells(NumFilas, 2).Value < "NEQ" _ Or Cells(NumFilas, 2).Value < "IBR" Then ..... end if however, the conditions are ignored when the program is running... why -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem with logical sentence
Cecilia,
I think you want ANDs instead of ORs. With ANDs, one of the < conditions will always be true, regardless of the value of Cells(NumFilas,2). -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "cecilia12345" wrote in message ... i have this conditional sentence If Cells(NumFilas, 2).Value < "NAFF" Or Cells(NumFilas, 2).Value < "NEQ" _ Or Cells(NumFilas, 2).Value < "IBR" Then .... end if however, the conditions are ignored when the program is running... why? --- Message posted from http://www.ExcelForum.com/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem with logical sentence
Have you tried bracketing the equations? Might work..
eg. If ((Cells(NumFilas, 2).Value < "NAFF") Or (Cells(NumFilas, 2).Value < "NEQ") _ Or (Cells(NumFilas, 2).Value < "IBR")) Then John "cecilia12345" wrote in message ... i have this conditional sentence If Cells(NumFilas, 2).Value < "NAFF" Or Cells(NumFilas, 2).Value < "NEQ" _ Or Cells(NumFilas, 2).Value < "IBR" Then .... end if however, the conditions are ignored when the program is running... why? --- Message posted from http://www.ExcelForum.com/ |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem with logical sentence
Because you should be using And <<grin.
-- Regards Brian "cecilia12345" wrote in message ... i have this conditional sentence If Cells(NumFilas, 2).Value < "NAFF" Or Cells(NumFilas, 2).Value < "NEQ" _ Or Cells(NumFilas, 2).Value < "IBR" Then .... end if however, the conditions are ignored when the program is running... why? --- Message posted from http://www.ExcelForum.com/ |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem with logical sentence
I think you want ANDs instead of ORs. With ANDs, one of the <
I meant With ANDs not ORs. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Chip Pearson" wrote in message ... Cecilia, I think you want ANDs instead of ORs. With ANDs, one of the < conditions will always be true, regardless of the value of Cells(NumFilas,2). -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "cecilia12345" wrote in message ... i have this conditional sentence If Cells(NumFilas, 2).Value < "NAFF" Or Cells(NumFilas, 2).Value < "NEQ" _ Or Cells(NumFilas, 2).Value < "IBR" Then .... end if however, the conditions are ignored when the program is running... why? --- Message posted from http://www.ExcelForum.com/ |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem with logical sentence
|
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem with logical sentence
-----Original Message----- i have this conditional sentence If Cells(NumFilas, 2).Value < "NAFF" Or Cells(NumFilas, 2).Value < "NEQ" _ Or Cells(NumFilas, 2).Value < "IBR" Then ..... end if however, the conditions are ignored when the program is running... why? --- Message posted from http://www.ExcelForum.com/ . Try sometihng like this MyCheck = Cells(NumFilas, 2).Value < "NAFF" Or Cells (NumFilas, 2).Value < "NEQ" _ Or Cells(NumFilas, 2).Value < "IBR" If MyCheck = True then... ' ome Else... End If |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem with logical sentence
At least two of the conditions will always be true. Change your OR to AND I
think. -- Regards, Tom Ogilvy cecilia12345 wrote in message ... i have this conditional sentence If Cells(NumFilas, 2).Value < "NAFF" Or Cells(NumFilas, 2).Value < "NEQ" _ Or Cells(NumFilas, 2).Value < "IBR" Then .... end if however, the conditions are ignored when the program is running... why? --- Message posted from http://www.ExcelForum.com/ |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem with logical sentence
Chip,
Want to try again? <bg Ryan -----Original Message----- I think you want ANDs instead of ORs. With ANDs, one of the < I meant With ANDs not ORs. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Chip Pearson" wrote in message ... Cecilia, I think you want ANDs instead of ORs. With ANDs, one of the < conditions will always be true, regardless of the value of Cells(NumFilas,2). -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "cecilia12345" <cecilia12345.yjxtb@excelforum- nospam.com wrote in message news:cecilia12345.yjxtb@excelforum- nospam.com... i have this conditional sentence If Cells(NumFilas, 2).Value < "NAFF" Or Cells (NumFilas, 2).Value < "NEQ" _ Or Cells(NumFilas, 2).Value < "IBR" Then .... end if however, the conditions are ignored when the program is running... why? --- Message posted from http://www.ExcelForum.com/ . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Help!!! - logical function for someone not very logical | Excel Worksheet Functions | |||
Simple Logical problem | Excel Discussion (Misc queries) | |||
Logical formula problem | Excel Worksheet Functions | |||
Problem with nested logical formula. | Excel Worksheet Functions | |||
Logical problem | Excel Discussion (Misc queries) |