Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Importing Text Files
When importing a comma-delimited .txt file, are there any settings that can
be made so that Excel automatically recognizes all leading zeros in fields? I am now going through the import wizard and changing the format from general to text for all fields that I can recognize that have leading zeros but this is cumbersome. |
#2
|
|||
|
|||
No.
But if you're always importing files with the same layout, you could record a macro when you import one of these files. Do all the stuff you want during the import, but keep recording when you add headers/page setup/filters/subtotals/whatever. Then when you need to open the next file, just rerun the macro. You could even ask the user (you???) for the name of the file to import: Option Explicit Sub testme() Dim myFileName As Variant myFileName = Application.GetOpenFilename(filefilter:="Text Files, *.Txt", _ Title:="Pick a File") If myFileName = False Then MsgBox "Ok, try later" 'user hit cancel Exit Sub End If Workbooks.OpenText Filename:=myFileName '....rest of recorded code here! End Sub You'll have to add all that .opentext stuff from your recorded macro. If you're new to macros, you may want to read David McRitchie's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm smith_gw wrote: When importing a comma-delimited .txt file, are there any settings that can be made so that Excel automatically recognizes all leading zeros in fields? I am now going through the import wizard and changing the format from general to text for all fields that I can recognize that have leading zeros but this is cumbersome. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Importing multiple Text files into Excel 2003 | Excel Discussion (Misc queries) | |||
Importing text files with mathematical characters | Excel Discussion (Misc queries) | |||
importing multiple text files URGENT!!! HELP | Excel Worksheet Functions | |||
importing multiple text files??? | Excel Discussion (Misc queries) | |||
Importing text files into Excel | Excel Discussion (Misc queries) |