+ Reply to Thread
Results 1 to 7 of 7

Decimal separator changes when save data to a txt file

  1. #1
    Forum Contributor
    Join Date
    09-21-2015
    Location
    nederland
    MS-Off Ver
    2021
    Posts
    203

    Decimal separator changes when save data to a txt file

    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 to save data as txt file .

    But, when I run the macro to save the data into a txt file (I have used below macros it automatically changes all "," into "."

    Please help how automatically changes all "." into "," ( on amount)


    Please Login or Register  to view this content.
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by kirana2014; 06-15-2021 at 02:42 PM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Decimal separator changes when save data to a txt file

    Hi,

    I'm somewhat confused

    I temporarily changed my Windows regional settings to match your Netherlands settings where the decimal separator is a comma and the file opens to show the numbers like 21,25 and not the 21.25 that you show in the picture.

    The eventual text file produced shows 21.25 whether I use the Dutch or UK settings
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: Decimal separator changes when save data to a txt file


    Quote Originally Posted by kirana2014 View Post
    when I run the macro to save the data into a txt file (I have used below macros it automatically changes all "," into "."
    Hi,

    just add to the SaveAs statement its Local parameter set to True

  4. #4
    Forum Contributor
    Join Date
    09-21-2015
    Location
    nederland
    MS-Off Ver
    2021
    Posts
    203

    Re: Decimal separator changes when save data to a txt file

    Dear Marc,

    Please help how to Add SaveAs statement its Local parameter set to True

  5. #5
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: Decimal separator changes when save data to a txt file


    As it's like its CreateBackup parameter so you can do it …

  6. #6
    Forum Contributor
    Join Date
    09-21-2015
    Location
    nederland
    MS-Off Ver
    2021
    Posts
    203

    Re: Decimal separator changes when save data to a txt file

    I try below but not working

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    09-21-2015
    Location
    nederland
    MS-Off Ver
    2021
    Posts
    203

    Re: Decimal separator changes when save data to a txt file

    Sub Save_txt()

    Sheets("data").Select
    Sheets("data").Copy
    ChDir "C:\Wayan Data"
    ActiveWorkbook.SaveAs Filename:="C:\Wayan Data\test123.txt", FileFormat:= _
    xlText, Clocal:=True
    ActiveWorkbook.Close
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replace decimal separator during data export to text file
    By crimsontrooper in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-06-2020, 05:24 AM
  2. Convert Number with comma as decimal separator to a decimal
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 07-20-2020, 08:35 AM
  3. data import and decimal separator interpretation
    By Diogo2 in forum Excel General
    Replies: 1
    Last Post: 04-02-2019, 10:35 AM
  4. Import CSV to Data Model - Change decimal separator
    By jawaka in forum Excel Charting & Pivots
    Replies: 23
    Last Post: 12-06-2017, 10:44 AM
  5. [SOLVED] Data extraction problem (decimal separator)
    By Villalobos in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-25-2017, 04:47 AM
  6. Getting decimal separator
    By Helge in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-01-2011, 08:23 AM
  7. Replies: 1
    Last Post: 09-08-2005, 07:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1