2016-11-02 64 views
0

我有以下查找如何更換可變

ActiveCell.FormulaR1C1 = _ 
     "=IFERROR(VLOOKUP(RC[-4], 'C:\Users\me\Downloads\Ca%2f_client_vlookup\[" & myFileNameCA & "]" & mySheetNameCA & "'!R10C1:R112C7,1,FALSE),"""")" 

我怎麼能存儲的值返回給變量RC公式價值?

+0

嘗試用'WorksheetFunction.VLookup' ... –

+0

我來到這裏的錯誤RC [-4] ..分離 – user138957

+0

哦,不,它不是那麼容易。你需要搜索一下如何使用'Worksheetfunction.function()'... [link](http://www.exceltrick.com/formulas_macros/vlookup-in-vba/)或[link](http ://www.cpearson.com/excel/callingworksheetfunctionsinvba.aspx) –

回答

0
dim variable 

variable = WorksheetFunction.VLOOKUP(RC[-4], 'C:\Users\me\Downloads\Ca%2f_client_vlookup\[" & myFileNameCA & "]" & mySheetNameCA & "'!R10C1:R112C7,1,FALSE) 
+0

這個不會因單引號而編譯... – arcadeprecinct