Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2004

    Unanswered: Floating Point pasting problem

    I'm using ADO, SQL, etc, to lnk Excel and Access. I've been running my queries, using .GetRows to the variant type, etc...

    I'm sure that the variant array created by .GetRows contains all the right values, because I used message boxes. For instance, in a certain place field that stores singles, i'm sure that the RecordSet/Array is returned as .05... I messaged by the variable right before it pastes and it says .05, but, once i paste it, it now reads .04996749 or something along those lines... I know about the floating point to binary conversion problems, but I still don't know how to fix it...

    Just to reiterate, the problem is that the SQL queries are returning the right numbers, but only when I paste it does the floating point problem come into effect...


  2. #2
    Join Date
    Oct 2003
    Just for clarification, are you wanting it to display just 0.05 or only retain the two decimal places? If the first, then it is a display issue vs. Floating Point problem. Is value in the cell showing up as number or text? Most likely coming from a database it is text. You can easily force it to be a number by putting number 1 in a cell, copying, then select the data and PasteSpecial, Multiply.
    old, slow, and confused
    but at least I'm inconsistent!

    (retired Excel 2003 user, 3/28/2008)

    How to ask a question on forums

  3. #3
    Join Date
    Jan 2004
    It was a display problem, caused by the floating point problem. Having the cell automatically set it to a number didn't help... But i think I fixed the problem by using the Val command before pasting it... Which I think would accomplish the same thing as your idea, but in the code, instead of in the worksheet... Thanks though...

Posting Permissions

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