On 06/18/09 22:31, Johnny Rosenberg wrote:
So A should be the content of the cell A1 in this case. However, if A1 is empty, A ends up as a double with the value 0. This makes it quite impossible to detect wether a cell is empty or not, doesn't it? At least I can't find a way to do that.
To a Basic function, an empty cell is passed as value 0, the function can't tell the difference.
Well, I have a theory, which I didn't test yet: Let's say that I just entered a custom cell function in cell B45. Can I be sure that B45 is the currently active cell when the function runs? Even if B45 is only one of a lot of cells that are calculated when autofill is performed? If so, I could just check the ActiveCell.getValue() and ActiveCell.getString() after first creating the object ActiveCell, of course, right?
That won't work. You mention autofill, but the function will also be called if input values are changed, when the formula is adjusted for inserted rows, after loading, and more.
If you make an add-in component instead of the Basic function, you can specify parameter type XCellRange and examine the passed object.
Alternatively, you can modify the formulas, as Jan suggested. Niklas --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
