• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Need to insert " when exported to CSV file i have some code but cant find how to add the " for each fields in CSV

augustus

New Member
augustus
Moderator question:
Why did You duplicate Your thread after You've opened this?
This thread could move to correct Forum.

>>> use code - tags <<<
Code:
Public Sub SaveAsCSV()
    Dim fn As String
    fn = "_" & Format(Now, "yyyymmddhhmmss")
    ThisWorkbook.Worksheets("Data").Copy
    With ActiveWorkbook
        Application.DisplayAlerts = False
        .SaveAs Filename:="C:\TMU-Export\TMU_Sales" & fn, FileFormat:=xlCSVUTF8
        Application.DisplayAlerts = True
        .Close savechanges:=False
    End With
End Sub
 
Last edited by a moderator:
Hi, as a csv file does not need any double quote so the SaveAs method with csv file type is not the way to go …​
See samples in this thread (in particular Demo2) :​
 
Back
Top