excel - Vlookup error in the first parameter -
i have problem in code. want value sheet , copy in active sheet problem condition inside loop.it gives me error in vlookup line. can detect me error:
with thisworkbook.sheets("plan traitement risque") = 6 lr1 step 1 'test si valeur cellule feuil1!=ax est dans plage col_2(feuil2!a1:a50)) if application.countif(col_2, .range("b" & i).value) = 0 cells(i, 3).select activecell.formula = "=vlookup(cells(i, 2).value,'scénarios de menace'!$b$6:$n$700,2,false)" end if next end
the active cell formula built string. if want pass vba function cells(a, b).value
string, need concatenate other parts of string, this:
activecell.formula = "=vlookup(""" & cells(i, 2).value & """,'scénarios de menace'!$b$6:$n$700,2,false)"
edit: added quotes accommodate string in cells(i,2), suggested in comment jeeped.
Comments
Post a Comment