LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 86
Default Does rounding work at all?

I still can't understand anything about this.

When I read the value of a cell in VB, the code returns a value rounded to 4
decimal places. The cell in question has a number that is out to about 8
decimals. And I'm not talking about the assignment, if you simply look at the
contents of the cell in the debugger, it's rounded off, ActiveSheet.Cells(i,
9) returns the wrong number!

But it's even worse. In order to get the SQL to find the row in the DB I
have to round both sides and compare the rounded values. So I have code
like...

theSql = theSql & " AND ROUND(value, 3) =" & Round(theTotal, 3)

The cell in question contains the value 1712.1465. Thus, the Round function
on the right side should return 1712.147. Well look what actually happens:

AND ROUND(value, 3) =1712.146

What the HECK is going on?!?

Maury

 
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
ROUNDING FORMULA =ROUND(B12/$B$10,1) ROUNDING TO HIGH SunshineinFt.Myers[_2_] Excel Worksheet Functions 7 March 5th 09 06:41 PM
Rounding time of day up to fall in during work hours Jon Ratzel[_2_] Excel Discussion (Misc queries) 8 January 31st 08 08:34 PM
I need a formula with rounding up & rounding down to the nearest . Tony Kay Excel Worksheet Functions 3 May 29th 07 11:13 PM
If I have a work sheet protected and try to run a macro to hide rows or columns it won't work. Correct? Marc Excel Programming 2 July 12th 06 04:10 AM
Worksheet rounding vs VBA rounding Simon Cleal Excel Programming 4 September 2nd 05 01:50 AM


All times are GMT +1. The time now is 09:53 AM.

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

About Us

"It's about Microsoft Excel"