Hi - I'm hoping someone can help with this. I am trying to include a vlookup in my code which reads from a file that I want to remain closed. At the moment I am having to open the relevant file and then close it once the vlookup is done. I have something like this at the moment:
Workbooks.OpenText FileName:="C:\Test\Trial1.xls"
Output = Application.VLookup(Cells(3, 1), Workbooks("Trial.xls").Worksheets("Sheet1").Range("A4:k1000"), 9, False)
Workbooks("Trial1.xls").Close
Anyone know how I can get around the opening and closing? Thanks a lot in advance
Workbooks.OpenText FileName:="C:\Test\Trial1.xls"
Output = Application.VLookup(Cells(3, 1), Workbooks("Trial.xls").Worksheets("Sheet1").Range("A4:k1000"), 9, False)
Workbooks("Trial1.xls").Close
Anyone know how I can get around the opening and closing? Thanks a lot in advance