Written by Allen Wyatt (last updated February 20, 2021)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and 2021
Wolfgang often imports CSV files that are created by other programs. When importing, he needs to specify how Excel should treat the incoming data. 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.
The short answer is no, there isn't such a format. Technically you can create an XML-formatted file that uses the format of Office, and it can specify what the field formats should be. Such a file consists of only text (like a traditional CSV file) and includes specifiers about how the data should be formatted. (Complete details on how such an XML file should be structured is beyond the scope of this tip.)
Such an endeavor is undeniably daunting to many people, so you could also 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 (11602) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and 2021. You can find a version of this tip for the older menu interface of Excel here: File Formats that Include Field Formats.
Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!
Want to make your importing of text data faster than ever? Here are some ideas you can apply right away.
Discover MoreDon't you hate opening a workbook and seeing error messages? If you see a message that some "invalid names" were detected ...
Discover MoreWhen storing your Excel workbook, you need to specify a file name to be used for the workbook. Take a moment to consider ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2021-02-20 06:48:08
Tom Kadlec
Another option is to use Power Query and Refresh the query.
2021-02-20 06:31:23
Rohn S, MVP 2012-2018
Another option would be to use PowerQuery. You can apply specific data types to columns, along with any other data modification you want to use. This information is saved in the query so it is re-applied the next time you refresh the query or use the query to import data from a new CSV file.
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2025 Sharon Parq Associates, Inc.
Comments