Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Comparison Operators

When two variables are declared as either single or double and used for
comparison, pls see below

Note that try1 and try2 are getting the value from excel worksheet, in this
case, may be
both are 508.19

double try1
double try2

when the following statement is executed, the excel micro will issue an
error try1 not equal to try2 even if both have the values of 508.19

if try1 < try2
generate eror message ' try1 not equal to try2'
end-if

Does anybody know why?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Comparison Operators

Why don't you print out the difference of the two?

debug.print try1, try2, try1-try2

It might help you figure out your problem.

"Devanath Ong" wrote:

When two variables are declared as either single or double and used for
comparison, pls see below

Note that try1 and try2 are getting the value from excel worksheet, in this
case, may be
both are 508.19

double try1
double try2

when the following statement is executed, the excel micro will issue an
error try1 not equal to try2 even if both have the values of 508.19

if try1 < try2
generate eror message ' try1 not equal to try2'
end-if

Does anybody know why?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default Comparison Operators

Hi
Are they really both EXACTLY 508.19, or is that only to 2 decimal
places?
regards
Paul

Devanath Ong wrote:
When two variables are declared as either single or double and used for
comparison, pls see below

Note that try1 and try2 are getting the value from excel worksheet, in this
case, may be
both are 508.19

double try1
double try2

when the following statement is executed, the excel micro will issue an
error try1 not equal to try2 even if both have the values of 508.19

if try1 < try2
generate eror message ' try1 not equal to try2'
end-if

Does anybody know why?


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
Comparison Operators in formulas Steve P[_2_] Excel Discussion (Misc queries) 1 November 5th 09 11:55 PM
Comparison Operators on a Toolbar Teacher in Need Excel Discussion (Misc queries) 0 October 3rd 06 08:00 PM
Unary operators Joe Excel Worksheet Functions 3 February 14th 05 06:09 PM
Comparison Operators for IF statement. Shams Excel Worksheet Functions 1 February 14th 05 03:35 PM
Using SELECT...CASE with comparison operators? Toby Erkson[_3_] Excel Programming 7 July 14th 04 09:52 PM


All times are GMT +1. The time now is 06:45 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"