I am trying to to a vlookup in another (opened) workbook.
I have done ths many times with great success.
Since yesterday, I have been working on this. The original sub and stuff were doing some pretty fancy stuff so, I kept trying to go for the basics.
Here is the code I am currently using:
For i = 1 To 20
MsgBox WorksheetFunction.VLookup(i, Workbooks("d:\desktop\testvlookup.xlsm").Sheets("Sheet1").Range("A:B"), 2, False)
I keep getting a subscript error.
If I try the same command from the same workbook (even different pages) with out the
it will work.
I try and paste "d:\desktop\testvlookup.xl
sm" in the run command and it says the book is open, so there is not a typo, and the file etc exists and is in fact open.
This is a very clean test workbook with "sheet1" having colA filled with numers 1-26 and column b filled with A-Z
What am I missing???
Office 2010. 32k under Win7 64bit