Excel VBA - Vlookup & range -
i defined cl
range , seek assign range info in table using vlookup
.
the result obtained vlookup
range address (example: e58
).
i unable assign range.
set cl= range ("=vlookup(i, range("a7:b28"), 2, false)")
that's not how run formula in vba. functions available in application
object (including vlookup
).
set cl = range(application.vlookup(i, range("a7:b28"), 2, false))
for others utilize application.worksheetfunction
object
set cl = range(application.worksheetfunction.vlookup(i, range("a7:b28"), 2, false))
note: there subtle differences in 2 approaches, notably on how functions handle errors. ant yes, should add together error handling code.
side note: if approach did work, need delimit "
's around a7:b28
, this
"=vlookup(i, range(""a7:b28""), 2, false)"
excel excel-vba
No comments:
Post a Comment