ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   opening a file from a cell reference (https://www.excelbanter.com/excel-programming/397395-opening-file-cell-reference.html)

[email protected][_2_]

opening a file from a cell reference
 
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


Caroline

opening a file from a cell reference
 
Try
Worksheets(Range("a1").value).activate
--
caroline


" wrote:

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



papou[_2_]

opening a file from a cell reference
 
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

a écrit dans le message de news:
...
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





All times are GMT +1. The time now is 11:01 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com