Nicolaf
12-19-2012, 07:59 AM
Hi,
I have some code that opens a specific file in a directory.
I would now like to amend it so that it opens the file which contains in its name a specific word.
The word will be contained in cell F2.
For example if file name is clientnames.xls then by putting word "names" in cell F2 this file should open.
My code is below:
IName = ThisWorkbook.Sheets("Sheet1").Range("F2").Value
Set NewWkbk = Workbooks.Open(Filename:="C:\" & IName)
How do I amend code for this new function??
Thanks,
:dunno :dunno
I have some code that opens a specific file in a directory.
I would now like to amend it so that it opens the file which contains in its name a specific word.
The word will be contained in cell F2.
For example if file name is clientnames.xls then by putting word "names" in cell F2 this file should open.
My code is below:
IName = ThisWorkbook.Sheets("Sheet1").Range("F2").Value
Set NewWkbk = Workbooks.Open(Filename:="C:\" & IName)
How do I amend code for this new function??
Thanks,
:dunno :dunno