Thread: Open File Marco
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Open File Marco

Hi,

Try this

Workbooks.Open Filename:=Sheets("Sheet1").Range("B4").Value

Mike

"Elton Law" wrote:

Dear Expert,
Say B4 cells contains a text C:\marco\main\help\income2009.xls
How is the VB script so that once I run the marco it will open the file in
accordance to the text in cell please ?
In future, I change the text in B4 to C:\marco\main\help\expense2009.xls
That marco can help me open that file too.
It is not a fixed file name and thus fixed VB script.
File name (to be opened) in cell B4 will be changed from time to time.
Thanks