+ Reply to Thread
Results 1 to 3 of 3

Excel question with variable definition

  1. #1
    Yong Kim
    Guest

    Excel question with variable definition

    Hi,

    I have a macro running on Excel 2003. I simply read a value from a cell
    using macro in which the value is defined as single, double, or even variant,
    then write the value on another cell. Now the number has some left over
    values. For instance, 100.1 becomes 100.099998474121. If the original number
    is an integer, then it is ok. However, any decimal number resulted in a
    different number though there is about 0.1% difference. Is there something I
    am doing wrong, or is this a bug? Any help would be appreciated.
    --
    Yong Kim

  2. #2
    Gary Brown
    Guest

    RE: Excel question with variable definition

    This is a 'bug' in Excel. For a full description, see the website below.
    The website specifically goes through Excel 97 but the same is true of Excel
    2003.
    http://www.cpearson.com/excel/rounding.htm

    To solve your problem, use the round() function.
    HTH,
    Gary Brown

    "Yong Kim" wrote:

    > Hi,
    >
    > I have a macro running on Excel 2003. I simply read a value from a cell
    > using macro in which the value is defined as single, double, or even variant,
    > then write the value on another cell. Now the number has some left over
    > values. For instance, 100.1 becomes 100.099998474121. If the original number
    > is an integer, then it is ok. However, any decimal number resulted in a
    > different number though there is about 0.1% difference. Is there something I
    > am doing wrong, or is this a bug? Any help would be appreciated.
    > --
    > Yong Kim


  3. #3
    Yong Kim
    Guest

    RE: Excel question with variable definition

    Thanks very much. It helped me to understand the problem. I really appreciate
    your support.

    "Gary Brown" wrote:

    > This is a 'bug' in Excel. For a full description, see the website below.
    > The website specifically goes through Excel 97 but the same is true of Excel
    > 2003.
    > http://www.cpearson.com/excel/rounding.htm
    >
    > To solve your problem, use the round() function.
    > HTH,
    > Gary Brown
    >
    > "Yong Kim" wrote:
    >
    > > Hi,
    > >
    > > I have a macro running on Excel 2003. I simply read a value from a cell
    > > using macro in which the value is defined as single, double, or even variant,
    > > then write the value on another cell. Now the number has some left over
    > > values. For instance, 100.1 becomes 100.099998474121. If the original number
    > > is an integer, then it is ok. However, any decimal number resulted in a
    > > different number though there is about 0.1% difference. Is there something I
    > > am doing wrong, or is this a bug? Any help would be appreciated.
    > > --
    > > Yong Kim


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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