+ Reply to Thread
Results 1 to 5 of 5

wrong divider in csv-file

  1. #1
    Registered User
    Join Date
    01-23-2010
    Location
    Hjoerring, Denmark
    MS-Off Ver
    Excel 2003
    Posts
    5

    Thumbs up wrong divider in csv-file

    Hi

    I am searching for a solution to this little problem:

    when saving a spreadsheet in csv-format from the user interface of Excel (a Danish version), the file is saved with a ";" as divider (Danish), which is what I want, but when the saving is executed in code like the code below, the file is saved with a "," as divider (USEnglish). When the file then is opened in Excel, each row of data are placed in one cell instead of multiple cells.

    Please Login or Register  to view this content.
    Please help me as I have a deadline in two days

    trolle
    Last edited by ptrolle; 01-25-2010 at 07:37 AM.

  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: wrong divider in csv-file

    Hi,

    Probably the simplest way is to just select the single column and use the Data Text to Columns functionality and pick the ';' delimiter.

    Alternatively you could temporarily change the list separator in the regional settings before opening the file.

    HTH
    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
    Registered User
    Join Date
    01-23-2010
    Location
    Hjoerring, Denmark
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: wrong divider in csv-file

    Thank you for the fast answer.

    Unfortunately your solutions are not applicable in this situation as the csv file is to be used by another application of which I know nothing. So I am forced to deliver the csv file in the "proper" format. The strange thing is, that it is only when the saving is done by the VB-code the problem arises. When saving is done from the Excel user interface, the csv file is delivered in the wanted format. I have checked the settings with this snippet:

    Please Login or Register  to view this content.
    and the settings are correctly set (Danish) but the code executor insists on delivering in USEnglish!!

    greetings trolle

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,947

    Re: wrong divider in csv-file

    The macro below will build a string of semi-colon delimited string from each row of your file and put that string in the first cell of the corresponding row of a new sheet. So when it is done, you will have a single column of semi-colon delimited values. The sheet is moved and saved as a CSV file.


    Please Login or Register  to view this content.
    Ben Van Johnson

  5. #5
    Registered User
    Join Date
    01-23-2010
    Location
    Hjoerring, Denmark
    MS-Off Ver
    Excel 2003
    Posts
    5

    Thumbs up Re: wrong divider in csv-file

    Hi

    Thank you for your inputs. I couldn't use any of your solutions but they inspired me to a simple and workable way to create the wanted output:

    Please Login or Register  to view this content.
    Thank you

    greetings trolle

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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