Code working in 2019 but not in 2007/2010

  • Hello code experts

    I have this application where bank statement are customized in the required order. The problem is it shows an error in older version of excel where the amounts contain a comma in the figures of columns E and F (Raw Data). It runs successfully in 2019. I need your expertise to edit the code to make it compatible for older versions also.

    compatible for 2007 customize .xlsm

    This is the error image as shown in older version of excel.

    compatible for 2007 customize .xlsm

  • Go to Best Answer
  • It's nothing to do with the version - those are stored as text, not numbers.

    Rory
    Theory is when you know something, but it doesn’t work. Practice is when something works, but you don’t know why. Programmers combine theory and practice: nothing works and they don’t know why

  • The image I sent is the result of the code in excel 2010 which is showing error in column J. The same code when run in 2019 doesn't show any errors in the result. I have shared the workbook in the above post with the code. If you have both the version of excel you can compare the result of both. I use excel 2019 at home and in the office they have 2010.

    It's nothing to do with the version - those are stored as text, not numbers.

  • The data in your Raw Data sheet is stored as text. I wasn't talking about your image.

    Rory
    Theory is when you know something, but it doesn’t work. Practice is when something works, but you don’t know why. Programmers combine theory and practice: nothing works and they don’t know why

  • The problem is not the Raw Data sheet. It is inserted into the workbook to customize. The problem is the result in the CleanData sheet where it is showing error in 2010 version of excel even after converting the text into numbers within the code. I want to know if any of the code lines are not compatible for older version of excel. If there are then I need to replace those lines.

    As I mentioned earlier, the code is converting the text into numbers and working fine in the 2019 version of excel. But the same is displaying error in the CleanData sheet.

    Code
                    OutputCheckColumnLetter).NumberFormat = "#,##0.00"                  '   Format Columns I & J to commas & 2 decimal places
  • The code does not convert any data. Your code doesn't work in 2016 either because many of the 'number' values in the source Raw Data sheet are actually text.

    Nothing in that code differs between Excel versions.

    Rory
    Theory is when you know something, but it doesn’t work. Practice is when something works, but you don’t know why. Programmers combine theory and practice: nothing works and they don’t know why

    • Best Answer

    This should fix your text data issue:


    Rory
    Theory is when you know something, but it doesn’t work. Practice is when something works, but you don’t know why. Programmers combine theory and practice: nothing works and they don’t know why

  • This should fix your text data issue:

    Thanks rory. It is working fine in 2019. Will check in 2010 in office tomorrow and revert back. Thanks once again.

  • rory. The code was successful in getting the right result in 2010 version. Thank you very much.

  • Great - glad we could help. :)

    Rory
    Theory is when you know something, but it doesn’t work. Practice is when something works, but you don’t know why. Programmers combine theory and practice: nothing works and they don’t know why

Participate now!

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