Decimal separator changes when exporting to a txt file

Lysebjerg78

New Member
Joined
Jul 1, 2011
Messages
2
Hi everyone

I hope someone here is able to help me, cuz I haven't succeed in finding the right way myself.

I have made some macros helping me importing data from a txt fileand to sort the data into a sheet ready to be exported into another txt file. I have made VBA helping me to work with "." as decimal separtor within the spreadsheet.

But, when I run the macro to export the data into a txt file (I have used the macros from this site http://www.cpearson.com/excel/ImpText.aspx) it automatically changes all "." into ","

But why?!?

I need the txt file to load data into another program, and this program need the use of "." as decimal separator - and not ",".

I'm using an European windows system...

BR
Lysebjerg78
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
try checking your language and keyboard settings in the control panel for list and decimal separators
 
Upvote 0
If your numbers are displayed in Excel with "." as decimal separator, then try changing this line in the macro...
CellValue = Cells(RowNdx, ColNdx).Value

To this....
CellValue = Cells(RowNdx, ColNdx).Text
 
Upvote 0
I have the same problem, using the same macro, but the (colleague's) computer also shows the decimal separator as a comma in the file. So I need to find a way to change the , into a . before exporting. Any simple ways to do this?
 
Upvote 0
I found a solution, using
Code:
CellValue = Cells(RowNdx, ColNdx).Value
but then
Code:
CellValue = Replace(CellValue, ",", ".")
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

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