opening a file from a cell reference

  • Thread starter Thread starter sfielder78
  • Start date Start date
S

sfielder78

I think this should be quite straight forward.

I would like to open a text file based on a cell reference

i.e. "example.txt" in cell A1.

Thanks

Simon
 
Hello Simon
Pretty straightforward, yes, provided info in A1 comporises of the full path
and name of the file.
eg:
Sub OpenFileNameFromCell()
With Worksheets("Sheet1")
If .[A1] <> "" Then
Workbooks.OpenText .[A1]
End If: End With
End Sub

HTH
Cordially
Pascal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top