Microsoft KB Archive/104411

= Microsoft Knowledge Base =

Excel: How to Avoid Space Delimiter When Using Export Command
Last reviewed: September 12, 1996

Article ID: Q104411

The information in this article applies to:


 * Microsoft Excel for Windows, versions 3.0, 4.0, 4.0a
 * Microsoft Excel for OS/2, version 3.0
 * Microsoft Excel for the Macintosh, versions 3.0, 4.0

When you use the Flat File add-in macro to to export a text file, the file retains the column width information and inserts a space as a delimiter between columns.

STATUS
This problem does not occur in later versions of Microsoft Excel for Windows.

WORKAROUND
If you want to export a text file without inserting this extra space, do the following to format the sheet with a monospace font (such as Courier):

 Open the file you want to export.  From the File menu, choose Open. Switch to the LIBRARY subdirectory and open the FLATFILE.XLA file (the FLAT FILE file if you are using   Microsoft Excel for the Macintosh).  From the Format menu, choose Style.  In the Style box, chose Define, and choose the Font button under Change.  In the Font dialog box, select Courier from the list of fonts.  In the Font dialog box choose OK, and choose OK again in the Style box.   Select the range of cells you want to export. From the Format menu, choose Column Width. Select the Best Fit button in the Column Width dialog box.   With the range of cells to export still selected, choose Export from the Data menu. </li>  In the Export dialog box, enter the filename of the text file (if    you don't specify a subdirectory here the file will be saved in the    active directory), and clear the Retain Cell Formats check box. </li> Choose the OK button.</li></ol>

Microsoft Excel will export the file without adding a space-delimiter between columns.

NOTE: In the exported file, numbers will appear in text format. Therefore, numbers that were right aligned in Microsoft Excel will be left aligned in the text file.