+ Reply to Thread
Results 1 to 3 of 3

How to solve long decimal on cell??

  1. #1
    Forum Contributor
    Join Date
    03-31-2012
    Location
    Hong Kong
    MS-Off Ver
    Excel 2010
    Posts
    140

    How to solve long decimal on cell??

    I want to return the cell Range("A1") is original value after loop and got ans. on cell Range("A2") , but I don't why the value have long decimal, how solve it?

    Dim temp as single, delta as singel
    temp = Range("A1") '6.12 original value

    Do....
    temp = temp + delta 'delta=0.01
    Range("A1") = temp 'Range("A1") should be 6.13 why =6.13000000123 ??
    loop

    Range("A2") = Application.Ceiling(temp , delta) 'Range("A2") should be 6.17 why=6.16999999123 ??

    Help and thanks..

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: How to solve long decimal on cell??

    Read this article by MS

  3. #3
    Forum Contributor
    Join Date
    03-31-2012
    Location
    Hong Kong
    MS-Off Ver
    Excel 2010
    Posts
    140

    Re: How to solve long decimal on cell??

    Quote Originally Posted by Pepe Le Mokko View Post
    Thanks for your reference, I think it may be a bug and I only fix it by Application.Round(Range("A1"),2).

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1