I am working with Excel 2016 on a Windows 7 system. While importing data from a text file (csv, tsv, etc.), in the third step of the data import wizard, the data type for each column can be configured manually. The default data type in that wizard page is "General". How can I change that default to "text" (or to other data type)?
Excel – How to set the default data type to “text” while importing data from a text file in Excel
microsoft excel
Best Answer
It's possible to change the default data type from General to Text, but VBA is required.
This Macro will import a Text file into Excel and will also specify the data type as TEXT.
Note: Please check the line
.TextFileColumnDataTypes = Array(2, 2, 2)
. Here 2 sets the TEXT format and the 3 ELEMENTS of the array specify 3 columns. You should set the array to have as many elements as the number of columns in your text file.