G
Greg Snidow
Greetings all. I know this exact question has been answered many times in
past posts, but I can not get it to work for anything. I need to populate a
formula in cell A17, and drag it down to the last cell in the range. This is
what I am trying:
*******************************************************
Sub PopulateFormula()
'First populate the formula in the top cell
Range("A17").FormulaR1C1 =
"=IF(ISERROR(VLOOKUP(C17,Region!A$2:B$98,2)),""NOT
LISTED"",VLOOKUP(C17,Region!A$2:B$98,2))"
'Then drag it down to last cell in range
Range("A17:A" & [D2000].End(xlUp).Row - 1).FillDown
End Sub
*********************************************************
I know it looks jumbled here, but in the code the formula is all on one
line. The drag down part works fine if I first manually populate the formula
in A17, but I can not get the macro to populate it for me. I am not sure of
the difference between Formula and FormulaR1C1, but I have tried both, and
neither work. I saw in a recent post that I need to double up the internal
quotes, so I did to no avail. I am sure it is something simple, but I can
not see it. Any ideas? Thank you
Greg Snidow
past posts, but I can not get it to work for anything. I need to populate a
formula in cell A17, and drag it down to the last cell in the range. This is
what I am trying:
*******************************************************
Sub PopulateFormula()
'First populate the formula in the top cell
Range("A17").FormulaR1C1 =
"=IF(ISERROR(VLOOKUP(C17,Region!A$2:B$98,2)),""NOT
LISTED"",VLOOKUP(C17,Region!A$2:B$98,2))"
'Then drag it down to last cell in range
Range("A17:A" & [D2000].End(xlUp).Row - 1).FillDown
End Sub
*********************************************************
I know it looks jumbled here, but in the code the formula is all on one
line. The drag down part works fine if I first manually populate the formula
in A17, but I can not get the macro to populate it for me. I am not sure of
the difference between Formula and FormulaR1C1, but I have tried both, and
neither work. I saw in a recent post that I need to double up the internal
quotes, so I did to no avail. I am sure it is something simple, but I can
not see it. Any ideas? Thank you
Greg Snidow