Johnny Andersson-3 wrote:
> 
> I just tried to write a macro, ACellF (ActiveCellFormula) for it. It
> didn't
> work at all...
> 
> Function ACellF() As String
>      ACellF=ThisComponent.getCurrentSelection.getFormula()
> End Function
> 
> 
> I entered =ACELLF() in a cell and all that showed up was "=ACELLF()",
> regardless which cell was selected. However, the function worked when
> called
> in a macro, but obviously not as a cell function. If someone knows why it
> doesn't work, I would be happy to know too...
> 
> I also XRayed it and it showed the formula of the currently selected cell.
> 
> Johnny Andersson
> 
> 

Hi, Johnny.  Such a function obtains its value at the time of entry of the
formula - i.e. when you enter =ACELLF() in the cell.  At that moment, the
current selection is the cell in which you enter the formula.  

To get the formula to recalculate, you need to use CTRL+SHIFT+F9 - one
limitation of such user-defined functions.

You will also find that the formula generates an error message when the
spreadsheet is loaded - possibly because "thiscomponent" does not then exist
- a serious limitation.
-- 
View this message in context: 
http://www.nabble.com/Calc-function-that-returns-the-value-of-the-current-cell--tf3167106.html#a8799733
Sent from the openoffice - users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to