Add VLOOKUP To Cell With Macro

  • I will be happy if someone can help me with Vlookup functionality. I have used VLOOKUP before but unable to fix this one on my own.

    What I'm trying to do is code a macro and use vlookup to get data from different file names specified in column "C". For eq: there is a file called "Asia.xls" and the word "Asia" is stored in column location R14C3.

    I tried the following code to append the filename to the filepath but it didn't work.

    Cells(14, "E").FormulaR1C1 = "=VLOOKUP(12,'I:\Quantitative Analysis\Performance Summaries\Key Funds and Peers\Peer Perf Reports\" & R14C3 & ".xls'!Performance_Table,MONTH(R12C5)+1,FALSE)"

    Please let me know if I'm unclear.

    Many Thanks,

  • Re: Vlookup Filepath

    I strongly suspect that

    & R14C3 &

    is the problem.
    This should be replaced with

    & Range("C14") &

    or some such.


Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!