Results 1 to 2 of 2

Save as .CSV - Speech marks / extra comma issues

Threaded View

  1. #1
    Registered User
    Join Date
    05-26-2015
    Location
    England
    MS-Off Ver
    2013
    Posts
    18

    Question Save as .CSV - Speech marks / extra comma issues

    Hi All,

    Hoping someone might have a quick solution to the following:

    I have a vba script that is saving a worksheet as a .csv file

    'CSV_Create is name of worksheet in master file I'm wanting to covert to .csv
    
    CSV_Create.Copy
    ActiveWorkbook.SaveAs Filename:=FullName, FileFormat:=xlCSV, CreateBackup:=True
    ActiveWorkbook.Close
    This correctly saves the .csv file, but depending on how I structure the data before .csv converting, I come across one of 2 errors in the output format compared to what I want.

    Option 1
    I have the data as a single text string, separated by commas in Column A.
    When re-opening as a .csv in notepad, this shows the correct information, but with speech marks around the string.

    i.e.

    "a,b,c,d" rather than a,b,c,d

    If I use this method, I need a way of removing the speech marks.

    Option 2
    I separate each bit of text into a column, however the final row of my data always has data in one extra column (an asterisk) to signify its the final line.
    This cannot be removed as the .csv file requires this to be processed correctly.

    Because of this, I get an additional, unwanted comma at the end of each row until the final line, highlighted in red below.

    i.e.

    a,b,c,d,
    e,f,g,h,
    i,j,k,l,*

    Any ideas how I can get the desired output:

    i.e.

    a,b,c,d
    e,f,g,h
    i,j,k,l,*

    Thanks

    Rob
    Last edited by wahbob; 06-09-2021 at 06:50 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Adding CHAR(10) to add line breaks causes speech marks to be added
    By Fozzy279 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-13-2020, 12:10 PM
  2. Formula to remove speech marks
    By james19 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-07-2014, 11:20 AM
  3. Help require to delete or reduce extra marks
    By mso3 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-15-2014, 06:46 PM
  4. how to remove text contained with speech marks
    By pablowilks in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-02-2012, 03:32 PM
  5. [SOLVED] drag-down of indirect function does not change cell refereence between speech marks
    By nils7 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-07-2012, 04:51 AM
  6. Adding a formula to a cell. Speech marks
    By Typicalalex1 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-07-2011, 07:36 AM
  7. Why does a sumif use double speech marks
    By owl37 in forum Excel General
    Replies: 1
    Last Post: 11-24-2005, 10:00 PM

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