Placing value into a cell without affecting its formula
Posted by Steve Wardle on April 23, 2001 4:56 AM
I am currently writing some VBA code in Excel97 that, when a user calls a function, sets up a request against an OLE Server which processes the request and issues a callback to Excel with the result. The result can then be placed in the appropriate cell.
I have the basics of this working and my only problem is when I try to enter a value into a particular cell, say 'A4', I cannot appear to do so without changing the formula that is set up for that cell.
Is it actually possible to write code, for example:
Sheet1.range(A4).value = "blah"
which will leave the formula for the cell unchanged?
Another approach might be to make a copy of the formula into a temporary variable, write in the new cell value and then set the cell's formula to be the contents of the temporary variable however this seems to result in the formula being evaluated again immediately which is no good.
I would appreciate any advice..