+ Reply to Thread
Results 1 to 2 of 2

Urgent ! CSV double quotation problem ?

Hybrid View

  1. #1
    kobeting
    Guest

    Urgent ! CSV double quotation problem ?

    Dear All,

    I need to write a Marco to export some data from an excel file to a new
    CSV file. Some data with double quotation mark will export to CSV file.

    For example, I need to export a column name with "ABC", my code is

    sheet1.cells(1,4).value = """ABC"""
    .......
    oWorkbook.save

    If I open the CSV file by using Excel, the cell display "ABC", so it is
    correct. But when I use notepad to open the CSV file. It displays """ABC""",
    it is not my target format.

    I would like to ask how can I change my code to display "ABC" (both Excel
    and Notepad).

    Thanks

  2. #2
    NickHK
    Guest

    Re: Urgent ! CSV double quotation problem ?

    kobeting,
    Notepad merely displays the text it finds in a file. It has no concept of
    ..csv.
    Excel attempts parsing of the structure. In this case .csv, with different
    data types (number, text, etc) and splitting the data into columns on the
    commas etc.

    So the quick answer is you cannot.

    NickHK

    "kobeting" <kobeting@discussions.microsoft.com> wrote in message
    news:8C7A403D-A822-4FCE-A205-2E9517911F42@microsoft.com...
    > Dear All,
    >
    > I need to write a Marco to export some data from an excel file to a new
    > CSV file. Some data with double quotation mark will export to CSV file.
    >
    > For example, I need to export a column name with "ABC", my code is
    >
    > sheet1.cells(1,4).value = """ABC"""
    > .......
    > oWorkbook.save
    >
    > If I open the CSV file by using Excel, the cell display "ABC", so it is
    > correct. But when I use notepad to open the CSV file. It displays

    """ABC""",
    > it is not my target format.
    >
    > I would like to ask how can I change my code to display "ABC" (both

    Excel
    > and Notepad).
    >
    > Thanks




+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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