Bill_Biggs
Well-known Member
- Joined
- Feb 6, 2007
- Messages
- 1,216
I have a column that a macro create selects to insert a formula in. The formula is like this:
=IF(OR(AL2={variable}),"Yes","No")
It places this fomula in AM2 but the column can vary so I am having to create a formula to plug in to the column. So This is the line from the macro that is supposed to do that:
ActiveCell.FormulaR1C1 = _
"=IF(OR(RC[-1]={" & K & "}),""Yes"",""No"")"
Now in the {} I want to place a string variable, K, that give this fomula its value seeking objective.
However, when ever I try to run it, this string errs out with an app or objects error. How should I be writing this so that the formula can be placed with the particular string I need it to find?
=IF(OR(AL2={variable}),"Yes","No")
It places this fomula in AM2 but the column can vary so I am having to create a formula to plug in to the column. So This is the line from the macro that is supposed to do that:
ActiveCell.FormulaR1C1 = _
"=IF(OR(RC[-1]={" & K & "}),""Yes"",""No"")"
Now in the {} I want to place a string variable, K, that give this fomula its value seeking objective.
However, when ever I try to run it, this string errs out with an app or objects error. How should I be writing this so that the formula can be placed with the particular string I need it to find?