The formula in a cell is simply a text string. You can retrieve it from the
cell, test it for a value in the normal way, and put it back into the cell.
I'm not sure which part of the code you are needing help in.
Perhaps you could post the code you've written so far and are having trouble
with.