shakethingsup
Board Regular
- Joined
- May 21, 2017
- Messages
- 64
- Office Version
- 365
- Platform
- Windows
Hello!
I googled a code to open a text file and I can't remember where I found the code. To be honest, I don't know what a querytable is yet. The file format is actually a "*.eft" which can be opened up in notepad.
I want to achieve 2 things:
What could I do differently? Please and thanks.
I googled a code to open a text file and I can't remember where I found the code. To be honest, I don't know what a querytable is yet. The file format is actually a "*.eft" which can be opened up in notepad.
I want to achieve 2 things:
- open the textfile in my CURRENT workbook and the current worksheet. - the code opens in a new second workbook.
- I want the information to populated in column G. - the code opens the text file in cell A1.
Sub openeft()
Dim filename
filename = Application.GetOpenFilename("Text Files (*.EFT), *.EFT")
If filename <> False Then
With ActiveSheet.QueryTables.Add(Connection:="TEXT;" & filename, Destination:=Range("$G$9"))
Workbooks.Open filename
End With
End If
Range("G:G").WrapText = True
Columns("G").ColumnWidth = 200
End Sub
What could I do differently? Please and thanks.
Last edited: