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

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Solved2.45K views

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

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,

selected answer

Try something like this:

selected as best answer

Simply the best place to learn Excel VBA