LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,101
Default Rounding Problem

I'm having a problem with rounding that I hope someone can help with. I've
written code in VB to take readings from a piece of test equipment and round
the value to a single decimal point before putting it into a spreadsheet.
The problem is that the actual values in the cells have 13 decimal places.
The cells are formatted as a number with one decimal place and that is how
they are displayed in the cell of the spreadsheet. But, when I click on the
cell and the actual value in shown in the Formula Bar, it shows the value
with 13 decimals places.

Code:
Dim TempStr As Single
TempStr = Round(Mid(ValueStr, 2, 14), 1)
Sheets("Temps").Cells(Rrow, (X * 2)) = TempStr

Results:
Cell Shows in Formula Bar
23.7 23.7000007629394
23.8 23.7999992370605
23.9 23.8999996185302
24.0 24
24.1 24.1000003814697
24.2 24.2000007629394
24.3 24.2999992370605
24.4 24.3999996185302
24.5 24.5
24.6 24.6000003814697
24.7 24.7000007629394
24.8 24.7999992370605
24.9 24.8999996185302
25.0 25

 
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
Importing from Excel Sheet Problem workerboy Excel Discussion (Misc queries) 0 August 18th 06 02:44 PM
Rounding to the Nearest Eighth L.sean9 Excel Discussion (Misc queries) 4 June 23rd 06 12:00 AM
Excel Startup Problem aussievic Excel Discussion (Misc queries) 1 June 12th 06 04:33 PM
Averaging and Rounding problem Hansel Excel Worksheet Functions 5 June 21st 05 03:24 AM
Freeze Pane problem in shared workbooks JM Excel Discussion (Misc queries) 1 February 1st 05 12:04 AM


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

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"