Hi,
Sorry if this is something you will say there are plenty of them everywhere. I know that. I have been through the whole day but I cannot fix one last thing.
I have the code below which I copied from around the forums (sorry I dont remember all). I would like to know if you would please kindly fix it for me like when I enter the specific file name in my cell A1 and it can search for only that specific file name and open. What I have been look trhough the whole day are only to open every file.
Sorry if this is something you will say there are plenty of them everywhere. I know that. I have been through the whole day but I cannot fix one last thing.
I have the code below which I copied from around the forums (sorry I dont remember all). I would like to know if you would please kindly fix it for me like when I enter the specific file name in my cell A1 and it can search for only that specific file name and open. What I have been look trhough the whole day are only to open every file.
Code:
[COLOR=#0000ff]Sub[/COLOR] A()
[COLOR=blue]Dim[/COLOR] wb [COLOR=blue]As[/COLOR] Workbook
[COLOR=blue]Dim[/COLOR] sLook() [COLOR=blue]As[/COLOR] [COLOR=blue]String[/COLOR], vLook [COLOR=blue]As[/COLOR] [COLOR=blue]Variant[/COLOR]
[COLOR=blue]Dim[/COLOR] fName [COLOR=blue]As[/COLOR] [COLOR=blue]String[/COLOR]
ReDim sLook(1 [COLOR=blue]To[/COLOR] 2) [COLOR=blue]As[/COLOR] [COLOR=blue]String[/COLOR]
sLook(1) = "C:\Ongoing\"
sLook(2) = "C:\Finishing\"
[COLOR=blue]For Each[/COLOR] vLook [COLOR=blue]In[/COLOR] sLook
fName = Dir(vLook & "*.xlsx")
Set wb = Workbooks.Open(Filename:=vlook & fname, ReadOnly:=True)
wb.Close Savechanges:=False
fName = Dir
[COLOR=blue]Next[/COLOR] vLook
[COLOR=blue]End Sub[/COLOR]