Using VBA to process Vlookups in multiple workbooks
Posted by Corey on November 15, 2001 1:29 PM
I am currently writing a macro suing VBA to process vlookups using two workbooks. I am unable to get the vlookup function to recognize the named range in another workbook. Here is what my code looks like.
Workbooks.Open FileName:=Ans1 'New workbook
Ans = ActiveSheet.Name 'Workbook sheet
Names.Add Name:="Fund_List", RefersToR1C1:="=" + (Ans) + "!R9C2:R500C10" 'Range named
File = "MA.xls" 'Main workbook
F = Workbooks(File).Worksheets(Ans).Range("C1001").Offset(Ctr, 0).Value 'File Name
R1 = Workbooks(Ans1).Worksheets(Ans).Range("Fund_List") 'Row Reference
C = 5 'Column Number
V = Application.WorksheetFunction.VLookup(F, R1, C, False)
Any suggestions?
Corey