Save Excel Files as Text Without Quotes (4 Methods)

Download the Practice Workbook


4 Methods to Save Excel Files as Text Without Quotes

Method 1 – Use the Text (Tab-Delimited) File Format to Save Excel Files as Text Without Quotes

  • Go to the File menu.

  • Click on Save As.

  • Select Text (Tab delimited) and hit the Save command.

Use Text (Tab Delimited) Format to Save Excel Files as a Text Without Quotes

If you open the text file in Notepad, you will see that there are no quotes in the text file at all.


Method 2 – Copy Data and Paste It to Notepad to Save Excel Files as Text Without Quotes

  • Select the cells in your Excel worksheet that you want to copy.
  • Press Ctrl + C to copy.

Copy Data and Paste It to Notepad to Save Excel Files as a Text Without Quotes

  • Open Notepad and paste your data by pressing Ctrl + V.

Read More: How to Open Word Document and Save As PDF or Docx with VBA Excel


Method 3 – Use Find and Replace to Save Excel Files as Text Without Quotes

  • Open your text file with quotes and copy it using Ctrl + C.

  • Open Microsoft Word and paste your copied data using Ctrl + V from the clipboard.
  • Press Ctrl + H to open the Find and Replace dialog box.
  • Enter a double quotation (“) in the Find what box.
  • Leave the Replace with box blank.
  • Hit Replace All.

Use Find and Replace to Save Excel Files as a Text Without Quotes

  • Copy the values back to Notepad.

Notepad also has a Find and Replace feature you can use.

Read More: Save Excel as CSV with Double Quotes (3 Simplest Methods)


Similar Readings


Method 1 – Use VBA Code to Save Excel Files as Text Without Quotes

Case 4.1 – VBA Code #1

  • Press Alt + F11 to open the VBA editor.
  • Go to Insert.
  • Select Module.

  • Copy the following code to the VBA editor and save it.
Private Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" _
(ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long

Private Const MAX_PATH As Long = 260

'Change the file_location and filetype accordingly
Const FlName = "C:\Users\mahdy\desktop\data.txt"

Sub Sample1()
    Dim tempFile As String
    Dim CurrentData As String, strData() As String
    Dim Line As String
    Dim WorkbookSize As Integer

        tempFile = TempPath & Format(Now, "ddmmyyyyhhmmss") & ".txt"

    ActiveWorkbook.SaveAs Filename:=tempFile 
    , FileFormat:=xlText, CreateBackup:=False

        Open tempFile For Binary As #1
    CurrentData = Space$(LOF(1))
    Get #1, , CurrentData
    Close #1
    strData() = Split(CurrentData, vbCrLf)

WorkbookSize = FreeFile()


    Open FlName For Output As #WorkbookSize

    For i = LBound(strData) To UBound(strData)
        Line = Replace(strData(i), """", "")
            Print #WorkbookSize, Line
    Next i

    Close #WorkbookSize




End Sub

Function TempPath() As String
    TempPath = String$(MAX_PATH, Chr$(0))
    GetTempPath MAX_PATH, TempPath
    TempPath = Replace(TempPath, Chr$(0), "")
End Function
  • Update the directory path of your output file and save the code again.

VBA Code #1 to Save Excel Files as a Text Without Quotes

  • Press the F5 button to run the code.

Read More: Excel VBA to Save as File Using Path from Cell (With Quick Steps)


Case 4.2 – VBA Code #2

You can save a specific portion of your Excel worksheet as a text file using the following VBA code:

  • Insert the following code in the VBA module (see Case 1 if needed).
Sub Export()

Dim r As Range, c As Range

Dim sTemp As String

Open "C:\Users\User\Desktop\Softeko\Data.txt" For Output As #1

For Each r In Selection.Rows

sTemp = ""

For Each c In r.Cells

sTemp = sTemp & c.Text & Chr(9)

Next c

While Right(sTemp, 1) = Chr(9)

sTemp = Left(sTemp, Len(sTemp) - 1)

Wend

Print #1, sTemp

Next r

Close #1

End Sub
  • Create a txt file and update the directory of the file in the code. Your selected cells will be directly saved into this text file without quotes.

VBA Code #1 to Save Excel Files as a Text Without Quotes

  • Go back to your Excel worksheet and select the cells that you want to export.
  • Go to Macros in the Developer tab or press Alt + F8 to open Macros.

  • Select Sheet6.Export and hit the Run command.

Read More: How to Save VBA Code in Excel (3 Suitable Methods)


Related Articles

Get FREE Advanced Excel Exercises with Solutions!
Mrinmoy Roy
Mrinmoy Roy

Mrinmoy Roy, a dedicated professional with a BSc in Electronics and Communication Engineering from Khulna University of Engineering & Technology, Bangladesh, brings over two years of expertise to the ExcelDemy project. As a prolific contributor, he has authored around 180 articles, showcasing his deep knowledge and passion for Microsoft Excel, Data Analysis, and VBA. His unwavering commitment to continuous learning, combined with versatile skills, renders him well-suited for roles in data management and spreadsheet solutions. He has interest... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo