Need Help In Modifying my vba code for reading a text file

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...
Solved1.74K views
0

Hi AnalystCave!

I need help in modifying my code below:

Sub test()
Dim fn As String
fn = “C:\Users\Bren\Documents\sleep tonight-december avenue.txt”
With CreateObject(“Scripting.FileSystemObject”).OpenTextFile(fn)
Do Until .AtEndOfStream
If .Line > 100 Then Exit Do
Cells(.Line, 24).Value = .ReadLine

Loop
.Close
End With
End Sub

It reads a text file but my desired output is for the text file to be copied in just one cell specifically….any suggestions would be a great help…Thanks in Advanced AnalystCave!!! More Power!!!

Yours Truly,
Bren

selected answer
0

Try something like this:

selected as best answer

Simply the best place to learn Excel VBA