Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problem with logical sentence

yes you were right.....


---
Message posted from http://www.ExcelForum.com/

  #7   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help!!! - logical function for someone not very logical ECH123 Excel Worksheet Functions 3 May 11th 09 04:14 PM
Simple Logical problem kknob Excel Discussion (Misc queries) 7 February 4th 08 05:58 PM
Logical formula problem irresistible007 Excel Worksheet Functions 1 November 17th 05 07:14 AM
Problem with nested logical formula. Bill R Excel Worksheet Functions 6 September 26th 05 04:36 AM
Logical problem kernelwiz Excel Discussion (Misc queries) 4 September 13th 05 10:35 PM


All times are GMT +1. The time now is 11:31 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"