Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: File Formats that Include Field Formats.

File Formats that Include Field Formats

by Allen Wyatt
(last updated July 16, 2015)

1

Wolfgang often imports CSV files that are created by other programs. When importing he needs to specify to Excel how it should treat the data that it is importing. This causes Wolfgang to wonder if there is a file format that Excel can import that has field formats embedded so that he doesn't have to do any manual work on import.

Unfortunately this cannot be done; Excel provides no way to add such information to a plain-text file it is importing. There is a potential workaround, however. You could simply import your CSV file with no formatting applied, and then use the macro recorder to record how you manually format the freshly imported data. This macro could then be executed every time you import another file that uses the same sort of data as the first CSV file you imported.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (3415) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: File Formats that Include Field Formats.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Top Margin Ignored when Printing

When you press the Print button in Excel, you want your worksheet to go to your printer and produce output as you expect. ...

Discover More

Determining the Day of the Month

When writing macros, you may need to know which day of the month a particular date represents. Here's how to use the Day ...

Discover More

Can't Use AutoRecover with a Document

Having trouble getting Word to save your AutoRecover documents? Don't turn the feature off; try the techniques described in ...

Discover More

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

MORE EXCELTIPS (MENU)

Setting a Default File Format

Excel normally saves workbooks using a default file format that is peculiar to your version of the program. You can configure ...

Discover More

Finding the Size of a Workbook

Keeping tabs on the size of a workbook can be important when using Excel. You have a couple of options that will allow you to ...

Discover More

Saving Information in a Text File

The VBA programming language provide with Excel allows you to create and modify text files quite easily. Here's how to open a ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments for this tip:

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is nine more than 2?

2015-06-05 16:51:53

L Drewes

I have used such a Macro to keep my bank data imports consistent (They have always provided a CSV formatted data import option).

If the bank changes the fields I just need to adjust (edit) the Macro to produce the same output results.

Avoid VBA "spaghetti" code. "Chunk" your coding efforts. "Record, test and comment" each block of code. You may not need to look at it again for months or even years!

Lou


Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.

Links and Sharing
Share