PDA

View Full Version : Using a defined string in a vlookup



Royalowl
04-13-2010, 04:08 AM
I have been trying to figure out how to use a defined string in a vlookup. I am trying to reference a different workbook to the one I am on and this will change every month, any ideas?

I have a work round in that I can save this file as a lookup sheet and reference this workbook but I'm sure there is an easier way, can anyone help?

Would want to change this from
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-13],'Lookup'!C[-13]:C[-12],1,FALSE)"

to state the defined workbook at the top e.g. Testfile

Bob Phillips
04-13-2010, 04:21 AM
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-13],'" & Testfile & "'!C[-13]:C[-12],1,FALSE)"