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

I have a form that compares the total values of several fields to a variable
value when the user clicks the Submit button. The fields need to equal the
variable value or the form will not be submitted. I ran into a problem where
the fields DO appear to equal the variable value, but excel says no....In
the immediate window, I type ?salecomm and get 1228.95. I then type
?salecomm = 1228.95 and get back FALSE. I cannot seem to duplicate this
problem with other random numbers. I get back TRUE when using other values.
I obviously have not tried every value, but I am lost for now. Any ideas
where I might start?

Thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Not equal to?

Try

?Round(salecomm,2) = 1228.95

it is probably because the actual value is 1228.95243357 or something, but
only showing 2 dec places.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Evan" wrote in message
...
I have a form that compares the total values of several fields to a

variable
value when the user clicks the Submit button. The fields need to equal the
variable value or the form will not be submitted. I ran into a problem

where
the fields DO appear to equal the variable value, but excel says no....In
the immediate window, I type ?salecomm and get 1228.95. I then type
?salecomm = 1228.95 and get back FALSE. I cannot seem to duplicate this
problem with other random numbers. I get back TRUE when using other

values.
I obviously have not tried every value, but I am lost for now. Any ideas
where I might start?

Thanks




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Not equal to?

Thanks, this solved the problem. Strange though, I have been using this
spreadsheet for years. The user enters a total value, which is stored as a
variable. The user then enters a subtotal, and is given the difference
between the total and the subtotal to confirm. It is then stored as another
variable. The numbers are ALWAYS whole numbers, or numbers with two decimal
places. I have not run into this problem with thousands of transactions.

For what it's worth, this was all written in Excel 2000. I upgraded to Excel
2002 and used it with no trouble for a couple of years with no problem. I
recently upgraded to Excel 2003. I can no longer use the file in 2000 or
2002 since saving it as 2003 because I get a lot of "object not found"
messages for code that I have not changed.

"Bob Phillips" wrote in message
...
Try

?Round(salecomm,2) = 1228.95

it is probably because the actual value is 1228.95243357 or something, but
only showing 2 dec places.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Evan" wrote in message
...
I have a form that compares the total values of several fields to a

variable
value when the user clicks the Submit button. The fields need to equal

the
variable value or the form will not be submitted. I ran into a problem

where
the fields DO appear to equal the variable value, but excel says

no....In
the immediate window, I type ?salecomm and get 1228.95. I then type
?salecomm = 1228.95 and get back FALSE. I cannot seem to duplicate this
problem with other random numbers. I get back TRUE when using other

values.
I obviously have not tried every value, but I am lost for now. Any ideas
where I might start?

Thanks






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Not equal to?

Evan,

Can't offer much help as I don't have Excel 2003, but it does sound strange.

Perhaps someone else has experienced this and understands it.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Evan" wrote in message
...
Thanks, this solved the problem. Strange though, I have been using this
spreadsheet for years. The user enters a total value, which is stored as a
variable. The user then enters a subtotal, and is given the difference
between the total and the subtotal to confirm. It is then stored as

another
variable. The numbers are ALWAYS whole numbers, or numbers with two

decimal
places. I have not run into this problem with thousands of transactions.

For what it's worth, this was all written in Excel 2000. I upgraded to

Excel
2002 and used it with no trouble for a couple of years with no problem. I
recently upgraded to Excel 2003. I can no longer use the file in 2000 or
2002 since saving it as 2003 because I get a lot of "object not found"
messages for code that I have not changed.

"Bob Phillips" wrote in message
...
Try

?Round(salecomm,2) = 1228.95

it is probably because the actual value is 1228.95243357 or something,

but
only showing 2 dec places.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Evan" wrote in message
...
I have a form that compares the total values of several fields to a

variable
value when the user clicks the Submit button. The fields need to equal

the
variable value or the form will not be submitted. I ran into a problem

where
the fields DO appear to equal the variable value, but excel says

no....In
the immediate window, I type ?salecomm and get 1228.95. I then type
?salecomm = 1228.95 and get back FALSE. I cannot seem to duplicate

this
problem with other random numbers. I get back TRUE when using other

values.
I obviously have not tried every value, but I am lost for now. Any

ideas
where I might start?

Thanks








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 837
Default Not equal to?

The "object not found" error has nothing to do with the code. Rather it
has to do with the infrastructure required to run VBA. Copy the VBA
code to Notepad and delete the modules. Then in Excel 2000 insert
modules and past the code from Notepad.

I have seen no evidence that the numerics have changed in 2003. I use
all three versions (Excel 2000, 2002, and 2003) if you want to post the
code (text only, not attachments).

Jerry

Evan wrote:

Thanks, this solved the problem. Strange though, I have been using this
spreadsheet for years. The user enters a total value, which is stored as a
variable. The user then enters a subtotal, and is given the difference
between the total and the subtotal to confirm. It is then stored as another
variable. The numbers are ALWAYS whole numbers, or numbers with two decimal
places. I have not run into this problem with thousands of transactions.

For what it's worth, this was all written in Excel 2000. I upgraded to Excel
2002 and used it with no trouble for a couple of years with no problem. I
recently upgraded to Excel 2003. I can no longer use the file in 2000 or
2002 since saving it as 2003 because I get a lot of "object not found"
messages for code that I have not changed.

"Bob Phillips" wrote in message
...

Try

?Round(salecomm,2) = 1228.95

it is probably because the actual value is 1228.95243357 or something, but
only showing 2 dec places.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Evan" wrote in message
.. .

I have a form that compares the total values of several fields to a

variable

value when the user clicks the Submit button. The fields need to equal

the

variable value or the form will not be submitted. I ran into a problem

where

the fields DO appear to equal the variable value, but excel says

no....In

the immediate window, I type ?salecomm and get 1228.95. I then type
?salecomm = 1228.95 and get back FALSE. I cannot seem to duplicate this
problem with other random numbers. I get back TRUE when using other

values.

I obviously have not tried every value, but I am lost for now. Any ideas
where I might start?

Thanks







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
can I make cell "yes" equal 1, "no" equal 0 can I make cell yes equal 1, no equa Excel Discussion (Misc queries) 4 April 22nd 23 06:09 AM
CountIF(A9:A20, B9 not equal B10, B10 not equal B11, etc.) Red Herald Excel Worksheet Functions 2 November 13th 08 12:11 AM
#ref to equal zero cherrynich Excel Worksheet Functions 2 February 6th 06 09:31 PM
Contains instead of Equal Jennifer Excel Worksheet Functions 4 September 13th 05 03:42 PM
Getting 0 to equal 1 soxn4n04 Excel Worksheet Functions 9 November 30th 04 04:15 PM


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