Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

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

  1. #11
    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

    Using the techniques shown here: https://analysistabs.com/vba/vba-wri...ithout-quotes/

    The code would look something like this:
    Code:
    Sub ExportData()
    
        Dim lr As Long
        Dim r As Long
        Dim myFileName As String
        Dim cellValue As Variant
        
        Sheets("Olink").Select
        
    '   Find last row with data in column P
        lr = Cells(Rows.Count, "P").End(xlUp).Row
        
    '   Prompt for full file path and name
        myFileName = Application.GetSaveAsFilename(fileFilter:="PRN (*.prn), *.prn")
        
    '   Create new file
        Open myFileName For Output As #1 
        
    '       Loop through all rows in column P
            For r = 1 To lr
    '           Capture value of cell
                cellValue = Cells(r, "P").Value
    '           Write to text file
                Print #1 , cellValue
    '       Move to next row
            Next r
    '   Close text file
        Close #1 
    
        MsgBox myFileName & " created"
    
    End Sub
    Note that there isn't any need to copy the data to a new sheet to do this. We can do it from column P on the Olink sheet.
    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!"

  2. #12
    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

    Just tried this and it works perfectly, thank you so much this will save me so much time removing the excess characters.

  3. #13
    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 are welcome.
    Glad I was able to help!
    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!"

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
  •