OK, let's see if I can explain this. I have a folder that contains 6-7 files that are saved with a ".xls" extension, but they are actually text files. I want to write a macro that when executed, first prompts the user to choose the appropriate folder that contains the files. Once they've done this, I want the macro to open the first file, convert to a ".xls" file (it is tab delimited), then copy/paste the data from that file into another workbook. I then want it to close the first file without saving, open the second file, convert to .xls, copy/paste the data directly below data from the first file. This process is repeated for all files in the selected folder.
When I recorded a macro to do the conversion from "text" to ".xls", here is the basic code it returned, if that helps in understanding the layout of the text files:
Workbooks.OpenText Filename:="The file name I chose", Origin:=437, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _
xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, _
Comma:=False, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), _
Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1)), TrailingMinusNumbers:=True
Can someone help?
When I recorded a macro to do the conversion from "text" to ".xls", here is the basic code it returned, if that helps in understanding the layout of the text files:
Workbooks.OpenText Filename:="The file name I chose", Origin:=437, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _
xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, _
Comma:=False, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), _
Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1)), TrailingMinusNumbers:=True
Can someone help?