y030210h1.xls | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | City | State | Zip | Zip | |||
2 | Detroit | MI | 48226 | 48226 | |||
3 | Rochester | MI | 48309 | 48309 | |||
4 | SomeTown | SD | 298 | 00298 | |||
5 | formatentries afterimporting toNumberSpecial FormatasZipCode | ||||||
6 | |||||||
7 | |||||||
8 | |||||||
9 | |||||||
Sheet5 |
Hi Thomas:predominantly said:What about creating a macro to apply text formatting to selected fields
in a csv file or xls file? Is this doable?
Range("C:C").NumberFormat="00000"
predominantly said:What about creating a macro to apply text formatting to selected fields
in a csv file or xls file? Is this doable?
Ekim said:Muffins,
Using Excel XP
• Open a new worksheet.
• Go to the Data menu | Import from External Data | Import Data.
• Navigate to your csv file, select it and then click the Open button.
• Automatically, you should now be in the “Text Import Wizard” and the radio button for “Delimiter” should be clicked.
• Click the Next button.
• Click the checkbox for “Comma”
• Click the Next button.
• In the Data Preview screen, click the column showing “00298”, and in the same dialog box, click the check box for Text (it’s under the heading “Column Data Format”).
• Click the Finish button
• In the next dialog box, choose where you want to put the data.
• Click OK.
Your formatting will be preserved.
HTH
Mike