stick3r Posted June 16, 2020 Share Posted June 16, 2020 Hi, I have excel with couple of sheets with numbers. I do some stuff with excel before and then I have this NumberFormat: 49252138,87 49252138,87 0,00 -22099,24 -22099,24 0,00 49230039,63 4,90 4,90 0,00 228390,07 0,00 228390,07 0,00 0,00 0,00 4,90 360000000,00 360000000,00 0,00 360000000,00 3349269,10 3349269,10 0,00 I change NumberFormat to Number, with 1000 separator and I get what I need - separated by dot and decimals separated by comma: 49.252.138,87 49.252.138,87 0,00 -22.099,24 -22.099,24 0,00 49.230.039,63 4,90 4,90 0,00 228.390,07 0,00 228.390,07 0,00 0,00 0,00 4,90 360.000.000,00 360.000.000,00 0,00 360.000.000,00 3.349.269,10 3.349.269,10 0,00 Macro recorded is this: Range("F42:H51").Select Selection.NumberFormat = "#,##0.00" I added this line to code: $o_Excel.Worksheets(2).Range("F42:H51").NumberFormat = "#,##0.00" What I get is this: 49252138,87000 49252138,87000 ,000 -22099,24000 -22099,24000 ,000 49230039,63000 4,9000 4,9000 ,000 228390,07000 ,000 228390,07000 ,000 ,000 ,000 4,9000 360000000,000 360000000,000 ,000 360000000,000 3349269,1000 3349269,1000 ,000 Any ideas how to fix this to show correctly? Thanks Link to comment Share on other sites More sharing options...
water Posted June 16, 2020 Share Posted June 16, 2020 Which language setting do you use for your system (US-english, German ...)? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
stick3r Posted June 16, 2020 Author Share Posted June 16, 2020 There are several of those. Country and Region - Sweden, Windows display language - English (United States), and in Region > Formats > Format: English (Sweden) Link to comment Share on other sites More sharing options...
water Posted June 16, 2020 Share Posted June 16, 2020 What do you get when you try: $o_Excel.Worksheets(2).Range("F42:H51").NumberFormat = "#.##0,00" dmob 1 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
water Posted June 16, 2020 Share Posted June 16, 2020 In Excel you can check the currently used separators by: File -> Options -> Advanced -> Use system seprator My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
stick3r Posted June 16, 2020 Author Share Posted June 16, 2020 1 hour ago, water said: What do you get when you try: $o_Excel.Worksheets(2).Range("F42:H51").NumberFormat = "#.##0,00" Whoo, this worked. Thanks! Link to comment Share on other sites More sharing options...
water Posted June 16, 2020 Share Posted June 16, 2020 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now