Find the fault in the code

  • Hello guys

    I have this code which Customizes a bank statement to the required columnar format. The code itself checks whether the closing balance is matched with the raw data. The problem is I am not able to figure out why in the check column I am getting a difference of 0.01 in some of the rows. I need your help to solve this problem. Column K amounts are manually entered with the help of a formula to check the difference.

    Amount difference 0.01.xlsm

  • Hello,

    No Fault in the code ... ;)

    Excel has a Number precision of 15 digits ... and therefore uses 15 decimals for calculation.

    As a consequence, compared to a manual input ...they can very easily differ from each other.

    You can fix this issue with a rounding formula.

    Hope this will help

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

  • Carim

    Changed the title of the thread from “Need help to find the fault in the code” to “Find the fault in the code”.
  • Carim. But, I have already done in the code.

                    OutputCheckColumnLetter).NumberFormat = "#,##0.00"                  '   Format Columns I & J to commas & 2 decimal places

    fyi, With the same code, some of the statements display correct values and some don't. This is one of them where they do not match.

  • After importing the customized data to the server, I just remembered that the columns closing balance and check are not included while importing the data to the server as they are not required. The import was perfect. The last 2 columns were just added in this application to check if any rows have been omitted while customizing the sheet. The problem of mismatch in those last 2 columns was there from the beginning and I didn't try to correct it as the import was successful and the amounts matched perfectly.


Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!