ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Link a file to worksheet (https://www.excelbanter.com/excel-discussion-misc-queries/173435-link-file-worksheet.html)

Stacie

Link a file to worksheet
 
I'm trying to open a worksheet depending on the month that the data is for.
For example, If I am looking at Jan Balance sheet on my first tab, I'd like
to pull the Jan Trial balance from a file. I have written a VLookup so that
the proper path/filename is displayed. How do I get Excel to open the file
name in cell A1?

Thank you.

CLR

Link a file to worksheet
 
Here's a little macro that will do it.........

Sub OpenFilenameInA1()
Worksheets("sheet1").Select
Workbooks.Open FileName:=Range("a1").Value
End Sub

Vaya con Dios,
Chuck, CABGx3



"Stacie" wrote:

I'm trying to open a worksheet depending on the month that the data is for.
For example, If I am looking at Jan Balance sheet on my first tab, I'd like
to pull the Jan Trial balance from a file. I have written a VLookup so that
the proper path/filename is displayed. How do I get Excel to open the file
name in cell A1?

Thank you.



All times are GMT +1. The time now is 09:53 AM.

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