Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Excel saving a file witout quotations
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Oct 2012
    Posts
    34
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Excel saving a file witout quotations

    Hey,

    I am trying to make some VBA that saves one row of data from a spreadsheet and saves it as a PRN file which I can do but it adds quotation marks to the start and end of every row, how do I go about removing them without having to do it manually?

    Here is my code;

    Code:
       Sheets("Olink").Select
        Columns("P:P").Select
        Range("P188").Activate
        Selection.Copy
        Sheets.Add after:=ActiveSheet
        Worksheets.Add().Name = "DD"
        Range("A1").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        myFolder = Application.GetSaveAsFilename(fileFilter:="PRN (*.prn), *.prn")
        ActiveWorkbook.SaveAs Filename:=myFolder, FileFormat:=xlCSV, CreateBackup:=False
    End Sub

  2. #2
    New Member
    Join Date
    Nov 2015
    Posts
    24
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Excel saving a file witout quotations

    i ran your code and it worked, don't see the quote marks though. maybe post your workbook.

  3. #3
    New Member
    Join Date
    Oct 2012
    Posts
    34
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Excel saving a file witout quotations

    Thanks for the help.

    How do I post my worksheet?

    I am opening the output with notepad 2 if that makes any difference.

  4. #4
    MrExcel MVP
    Junior Admin
    Joe4's Avatar
    Join Date
    Aug 2002
    Posts
    49,667
    Post Thanks / Like
    Mentioned
    51 Post(s)
    Tagged
    11 Thread(s)

    Default Re: Excel saving a file witout quotations

    You cannot upload files to this site. But there are tools you can use to post screen images. They are listed in Section B of this link here: http://www.mrexcel.com/forum/board-a...forum-use.html.
    Also, there is a Test Here forum on this board that you can use to test out these tools to make sure they are working correctly before using them in your question.

    Note that sometimes people will upload files to a file share site, and provide links to it here. Just note that for security reasons, many people are unable or unwilling to download files from the internet (especially ones with VBA code).
    TIPS FOR FINDING EXCEL SOLUTIONS
    1. Use the built-in Help that comes with Excel/Access
    2. Use the Search functionality on this board
    3. A lot of VBA code can be acquired by using the Macro Recorder.

    "Give a man a fish, feed him for a day. Teach a man to fish, feed him for life!"

  5. #5
    New Member
    Join Date
    Nov 2015
    Posts
    24
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Excel saving a file witout quotations

    to post your workbook,go to http://www.tinyupload.com/ and upload. then post the URL to this forum

  6. #6
    New Member
    Join Date
    Oct 2012
    Posts
    34
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Excel saving a file witout quotations

    The site is blocked by my provider so I guess I cant do that, thanks for the help anyway.

  7. #7
    MrExcel MVP
    Junior Admin
    Joe4's Avatar
    Join Date
    Aug 2002
    Posts
    49,667
    Post Thanks / Like
    Mentioned
    51 Post(s)
    Tagged
    11 Thread(s)

    Default Re: Excel saving a file witout quotations

    The site is blocked by my provider so I guess I cant do that, thanks for the help anyway.
    Are you able to use any of the tools discussed in the first link I provided?

    Also, it looks like your code may just be copying a single cell (P188). If that is the case, could you just copy/paste the contents of that cell here for us to see?
    Last edited by Joe4; Jun 20th, 2019 at 10:25 AM.
    TIPS FOR FINDING EXCEL SOLUTIONS
    1. Use the built-in Help that comes with Excel/Access
    2. Use the Search functionality on this board
    3. A lot of VBA code can be acquired by using the Macro Recorder.

    "Give a man a fish, feed him for a day. Teach a man to fish, feed him for life!"

  8. #8
    New Member
    Join Date
    Oct 2012
    Posts
    34
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Excel saving a file witout quotations

    HDR,JV1909110SP,Y,Y
    VHD,PJE,OL,JV1909110SP,GL,Book ATM Income 01/05-31/05/19,30/06/2019,N,,SUB
    VIL,NL,01-1179-0390,GLJ,JV1909110SP,Book ATM Income 01/05-31/05/19,30/06/2019,GBP,47.47,1,47.47,CR,,
    VIL,NL,01-1262-0390,GLJ,JV1909110SP,Book ATM Income 01/05-31/05/19,30/06/2019,GBP,41.07,1,41.07,CR,,
    VIL,NL,01-1276-0390,GLJ,JV1909110SP,Book ATM Income 01/05-31/05/19,30/06/2019,GBP,54.29,1,54.29,CR,,
    FLT,21269.6,21269.6,194,1,198


    That is the outcome of the cells although they are a formulae cell if that matters the formulae is below;

    =CLEAN(IF(C3="","",OLink!A3&","&OLink!B3&","&OLink!C3&","&OLink!D3&","&OLink!E3&","&OLink!F3&","&TEXT(OLink!G3,"DD/MM/YYYY")&","&OLink!H3&","&OLink!I3&","&OLink!J3&","&OLink!K3&","&OLink!L3&",,"))

    I am trying the other alternatives but my provider is not great

  9. #9
    MrExcel MVP
    Junior Admin
    Joe4's Avatar
    Join Date
    Aug 2002
    Posts
    49,667
    Post Thanks / Like
    Mentioned
    51 Post(s)
    Tagged
    11 Thread(s)

    Default Re: Excel saving a file witout quotations

    I did some testing, and it is because your data has commas in it. Excel automatically does to differentiate literal commas in data from commas used as delimiters.
    I have seen people get around that by having VBA code write directly to a text file instead of saving it as a text file.

    You also have an error in your code.
    This:
    Code:
    Worksheets.Add().Name = "DD"
    should look like this:
    Code:
    Worksheets.Add.Name = "DD"
    TIPS FOR FINDING EXCEL SOLUTIONS
    1. Use the built-in Help that comes with Excel/Access
    2. Use the Search functionality on this board
    3. A lot of VBA code can be acquired by using the Macro Recorder.

    "Give a man a fish, feed him for a day. Teach a man to fish, feed him for life!"

  10. #10
    New Member
    Join Date
    Oct 2012
    Posts
    34
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Excel saving a file witout quotations

    Thanks

    That makes sense, how would I write it to a text file instead of saving it?

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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