As long as the entire path & file name (including the file extension) exists in A1 of the
active sheet, does something like this work for you?
fName = [A1].Value
Application.ScreenUpdating = False
On Error Resume Next
If Len(fName) <> 0 Then
If Err = 0 Then
'change Sheet1 to the sheet with the value you want from A2
'change A2 to the cell you want the value of
'change D10 to the cell you want that value displayed in
MsgBox ("The file '" & fName & "' does not exist in the specified file path."), , fName & " not found"
Application.ScreenUpdating = True
Dim myF As String, ff As Integer, txt As String
ff = FreeFile
myF = Range("a1").Value
txt = Space(FileLen(myF))
Open myF For Binary As #ff
Get #ff, ,Txt
Sheets("Sheet1").Range("a2").Value = txt
Hi HalfAce, thanks that's almost done it. Only problem is instead of displaying the results of the textfile in cell A2, it displays them in cell A1 of a new sheet it creates, which has the sheet name matching the filename.txt.
What do I do to the code to just make it bring the info from the textfile and put it in cell A2?