Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Going nuts on this one...

I can't figure out why the following expression is evaluating to True when
UCase(z(i, 1)) is equal to ""
What am I missing here. Thanks in advance for any help.

If UCase(z(i, 1)) < "CS" And UCase(z(i, 1)) < "" And UCase(.Cells(intPos,
8)) = "CS" Or UCase(.Cells(intPos, 8)) = "" Then



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Going nuts on this one...

? true and false and false or true
True
? true and false and true or false
False

I believe it evaluates from left to right, to in the first case

True and False is False then

False and false = False

then
false or true = True
so true is the result

in the second case

True and false = False
False and true = False
False or False = False

Probably need to be specific

If (UCase(z(i, 1)) < "CS" And UCase(z(i, 1)) < "") And
(UCase(.Cells(intPos,
8)) = "CS" Or UCase(.Cells(intPos, 8))) = "" Then



or whatever you intent is.

--
Regards,
Tom Ogilvy



"AD108" wrote in message
...
I can't figure out why the following expression is evaluating to True when
UCase(z(i, 1)) is equal to ""
What am I missing here. Thanks in advance for any help.

If UCase(z(i, 1)) < "CS" And UCase(z(i, 1)) < "" And
UCase(.Cells(intPos, 8)) = "CS" Or UCase(.Cells(intPos, 8)) = "" Then





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Going nuts on this one...

Thanks very much Tom,

Much appreciated. I was able to work this out eventually, but I had to
rearrange the structure of all the logic.




"Tom Ogilvy" wrote in message
...
? true and false and false or true
True
? true and false and true or false
False

I believe it evaluates from left to right, to in the first case

True and False is False then

False and false = False

then
false or true = True
so true is the result

in the second case

True and false = False
False and true = False
False or False = False

Probably need to be specific

If (UCase(z(i, 1)) < "CS" And UCase(z(i, 1)) < "") And
(UCase(.Cells(intPos,
8)) = "CS" Or UCase(.Cells(intPos, 8))) = "" Then



or whatever you intent is.

--
Regards,
Tom Ogilvy



"AD108" wrote in message
...
I can't figure out why the following expression is evaluating to True when
UCase(z(i, 1)) is equal to ""
What am I missing here. Thanks in advance for any help.

If UCase(z(i, 1)) < "CS" And UCase(z(i, 1)) < "" And
UCase(.Cells(intPos, 8)) = "CS" Or UCase(.Cells(intPos, 8)) = "" Then







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
Going nuts in Excel 2003 Rich D Excel Discussion (Misc queries) 7 January 4th 08 03:31 AM
Help! Excel Has Gone Nuts! Gordon Arnaut Excel Discussion (Misc queries) 2 July 6th 07 03:40 AM
My Boss is nuts John21 Excel Worksheet Functions 1 August 4th 06 06:15 PM
Need Help, this is driving me nuts heitorfjr Excel Discussion (Misc queries) 2 January 15th 06 03:10 PM
This drives me nuts Pete K Excel Programming 5 April 9th 04 10:49 PM


All times are GMT +1. The time now is 02:48 AM.

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"