如何使用vlookup查找结果,并将变量作为VBA中的查找值?
示例:
Dim JobNumber
ActiveCell.FormulaR1C1 = _
"=(VLOOKUP(JobNumber,'Job List'!C[1]:C[4],1,FALSE)
答案 0 :(得分:1)
就这么简单:
Dim JobNumber
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(" & JobNumber & ",'Job List'!C[1]:C[4],1,FALSE)"