I am trying to write a code that will allow me to import an external text file and format it by column.
I have tried a few different methods and I think delimiting is the best method for what I want to do.
Sub Import_TxtFile()
Dim TXT As Range
Open "C:\Users\hpeshek\Desktop\Excel Testing\Test 3.txt" For Input As #1
'Run the procedure while it is not at the end of the file
Do While Not EOF(1) 'Loop until End of File
Line Input #1, TXT 'Read line into variable
'I think if i can get the following to work then the import will be successful
TXT.TextToColumns _
Destination:=Range("A1:"), _
DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=False, _
Tab:=True, _
Semicolon:=False, _
Comma:=False, _
Space:=False, _
Other:=False, _
OtherChar:=False
Loop
Close #1 'Close file
End Sub
I think my issue is that I can't format the TXT as a range for TextToColumns function. Does anyone know what it should be designated as?