Hi,
I have a big problem in my master thesis.
I want to read many text file into excel file for data analyses. The text files are so numerous that I can not read the files one by one. So I plan to read it into excel by VBA code. But I just learn to how to read one file into excel, and do not know how to deal with numerous. I can modify to name the files with number. My code:
Sub opentext()
Dim i As Integer
For i = 1 To 10000
Workbooks.opentext Filename:="D\:
VB\10000+i.out", _ /The text file can be name as 10001, 10002,....
Origin:=xlMSDOS, _
StartRow:=1, _
DataType:=xlDelimited, _
ConsecutiveDelimiter:=True, _
Space:=True
Next i
End Sub
Obviously, the code can not work. Could somebody give me a help. Thanks in advance.