Bruj
asked on
Issues with vlookup in Excel
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:
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
Thanks
Bruce
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:
Sub test()
For i = 1 To 20
MsgBox WorksheetFunction.VLookup(i, Workbooks("d:\desktop\testvlookup.xlsm").Sheets("Sheet1").Range("A:B"), 2, False)
Next
End Sub
I keep getting a subscript error.
If I try the same command from the same workbook (even different pages) with out the
Workbooks("d:\desktop\testvlookup.xlsm")
it will work.
I try and paste "d:\desktop\testvlookup.xl
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
Thanks
Bruce
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
DOH!!!!!
I have been working and working on this! I feel like an idiot.... Sum times ya just cant see the obvious!
Thanks guys!
Bruce
I have been working and working on this! I feel like an idiot.... Sum times ya just cant see the obvious!
Thanks guys!
Bruce
Thanks, Bruce. We've all been there!
Specifying the path wouldn't work for a closed file either.
Regards,
Brian.