MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Formula and Variable... Need help!!!

Posted by Flavio Filho on October 09, 2001 11:36 AM

I need to know if it´s possible to have a formula like this one where A are variables I assigned before....
Thanks in advance

ActiveCell.FormulaR1C1 = "=IF(ISERROR(SEARCH(""~*"", R[-a]C,1)), ""X"",R[-a]C)"

Posted by Barrie Davidson on October 09, 2001 11:43 AM

Yes, just change your code to:

ActiveCell.FormulaR1C1 = "=IF(ISERROR(SEARCH(""~*"", R[-" & a & "]C,1)), ""X"",R[-" & a & "]C)"

BarrieBarrie Davidson