Excel: Flat File Formats Noncontiguous Selections Vertically

Last reviewed: November 30, 1994
Article ID: Q78637
The information in this article applies to:
  • Microsoft Excel for Windows, versions 3.0, 4.0

SUMMARY

In Microsoft Excel, if you use the Flat File add-in macro to export a noncontiguous selection to a text file, each individual range is printed below the previous one, regardless of the relationship of the two ranges on the worksheet.

Note that in Microsoft Excel version 5.0, you can use the Text Import Wizard when you open a text file to control what data to import and how the data should be spread across columns.

MORE INFORMATION

Flat File (FLATFILE.XLA) allows you to export data from a worksheet to a text file. It will not preserve the relative positions of ranges to each other when you export a noncontiguous selection. For example, if the data that you are exporting includes the noncontiguous ranges A1:A4 and D1:D4, you might expect the resulting text file to consist of two columns of data. However, because Flat File treats each range in the non-contiguous selection separately, you will see a single column of data containing the values from both ranges in the resulting text file.

Note: The "Microsoft Excel User's Guide" version 3.0 states on page 684 that the export range you select must be a contiguous range. The "Microsoft Excel User's Guide 2" version 4.0 states on page 152 that the export range must be contiguous. This is incorrect. Flat File is able to export a noncontiguous selection.

Workaround

This behavior is by design. To work around this behavior, you must manipulate the ranges to export so that they are next to each other and select them as a contiguous range. In some cases, you can do this by hiding the columns or rows that you do not want to include in your export range, as the Flat File macro will only export what is displayed on the screen.

REFERENCES

"Microsoft Excel User's Guide 2," version 4.0, page 152

"Microsoft Excel User's Guide," version 3.0, page 78, 543, 683-684


KBCategory: kbdocerr
KBSubcategory:

Additional reference words: 3.0 3.00 4.0 4.00 docerr flatfile


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 30, 1994
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.