How would I programmatically (within a VBA macro) set the contents of a cell to be a formula ?
For example, I know I can set a cell to the contents of a string, by doing
Sheets("Out").Cells(row, col) = str
I tried something like
Sheets("Out").Cells(11, col) = "=IF(NOT( ISBLANK(F11) ), IF(F11<E11,-(E11-F11),F11-E11), "")"
but that of course didn't work.
The formula
Formula:
=IF(NOT( ISBLANK(F11) ), IF(F11<E11,-(E11-F11),F11-E11), "")
works for me, but I want to be able to programmatically place it in a cell, while incrementing the cell references in the formula ... IE: E11, F11 .... E12, F12, .... E13, F13 .......
Thanks
Bookmarks