Importing text with VBA and problems with language settings

CsJHUN

Active Member
Joined
Jan 13, 2015
Messages
360
Office Version
  1. 365
  2. 2021
  3. 2019
Platform
  1. Windows
  2. Mobile
Hi guys,

I'm importing text data separated with ";" . The numbers decimal sign is "," in the CSV, so 14,000 = 14
I have 2 file if im import (drag and drop) into first its works like charm, if i drop into other its give wrong numbers 14,000 = 14000.
Does anyone know any solution?

The first file is ~20MB, i recreated it totally the same "layout", same sheets, similar macro, so on but its 400kb. I didnt found why is the old one is so big.
The first one is the old one, not i made, give correct value for numbers. The 2nd one is a new one, i (re)made it, not giving correct values.
The macro recorder give the same results importing(dragging) to each file. I guess the excel temporary change the language settings while the old file running, is this possible?

Thx for ideas :)
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
I cannot edit.... :S
Is there a way to change the windows/excel langauge settings temporary with VBA?
 
Upvote 0
I found the solution of my problem:
on the workbook properties macro:
Code:
Private Sub Workbook_Open()    Application.UseSystemSeparators = False
    Application.DecimalSeparator = ","
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
    Application.UseSystemSeparators = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,549
Members
449,089
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top