Saving Tab Delimited - Without quotes!


Well-known Member
Mar 2, 2009

I'm having some issues with understanding this:

Basically, we have to edit some description data to import into another system and save it as a Text (Tab Delimited) file. However, when we come to open it, it has entered " around the text (which crashes the system and causes all kinds of problems) :mad:

I've tried to understand the Microsoft support page but don't know if this is the best approach. Is there a better Macro I could use?

Ideally I want to add this to a couple of peoples QAT's so they can press it to save their documents, but don't know where to start! I want to allow the user to specify where to save it and give it a filename but not to put the " in.

Some videos you may like

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.


Well-known Member
Mar 2, 2009

I've tried creating the Macro off the site but it doesn't appear to have instructions for 2007.


Well-known Member
Mar 2, 2009
  1. A1: TextFile Macro
    A2: =SET.NAME("nextcol",0)
    A3: getname=FOPEN(INPUT("Filename:",2),3)
    A4: =SET.NAME("colcount",COLUMNS(SELECTION()))
    A5: =FOR.CELL("current",SELECTION())
    A6: =IF(AND(ISNUMBER(current),GET.CELL(7,current)<>"General"))
    A7: =FWRITE(getname,TEXT(current,GET.CELL(7,current)))
    A8: =ELSE()
    A9: =FWRITE(getname,current)
    A10: =END.IF()
    A11: =SET.NAME("nextcol",nextcol+1)
    A12: =IF(nextcol=colcount)
    A13: =FWRITE(getname,CHAR(13)&CHAR(10))
    A14: =SET.NAME("nextcol",0)
    A15: =ELSE()
    A16: =FWRITE(getname,CHAR(9))
    A17: =END.IF()
    A18: =NEXT()
    A19: =FCLOSE(getname)
    A20: =RETURN()
  2. Select cell A1, on the Macro sheet.
  3. On the Insert menu, point to Name and click Define. Click the TextFile Macro so that the title appears in the "Names in workbook" box.
  4. In the "Refers to" box, verify the address of the macro is:
  5. Under Macro, click Command, and then click OK.
  6. Switch to the sheet that contains the range that you want to export and select that range.
  7. On the Macro menu, click Run. In the Macro dialog box, select the TextFile macro and click OK.
  8. A dialog box will prompt you for a file name, and the file will be written to that name. Name should include the file name extension if needed.

    CAUTION: Any existing files with that same name will be overwritten by the new text file.
It's this one off the Microsoft site, but it only gives instruction for 97 and I'm on 2007. I can't find whereabouts on 07 to do step 3!! Its driving me crazy!

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Latest member

This Week's Hot Topics

  • Turn fraction around
    Hello I need to turn a fraction around, for example I have 1/3 but I need to present as 3/1
  • TIme Clock record reformatting to ???
    Hello All, I'd like some help formatting this (Tbl-A)(Loaded via Power Query) [ATTACH type="full" width="511px" alt="PQdata.png"]22252[/ATTACH]...
  • TextBox Match
    hi, I am having a few issues with my code below, what I need it to do is when they enter a value in textbox8 (QTY) either 1,2 or 3 the 3 textboxes...
  • Using Large function based on Multiple Criteria
    Hello, I can't seem to get a Large formula to work based on two criteria's. I can easily get a oldest value based one value, but I'm struggling...
  • Can you check my code please
    Hi, Im going round in circles with a Compil Error End With Without With Here is the code [CODE=rich] Private Sub...
  • Combining 2 pivot tables into 1 chart
    Hello everyone, My question sounds simple but I do not know the answer. I have 2 pivot tables and 2 charts that go with this. However I want to...