Johnny Andersson wrote:

I have a not so big spreadsheet (OpenOffice.org Calc 1.1.5) and I though of creating a macro which looks in certain cells for bad values and correcting them. My thought is that every time I enter something in a cell, the macro looks in it and corrects it if necessary.

The "dream" is that I can assing every change in a specific cell to a macro, for example when I change the value in C3 and press Enter, a macro will start checking and, if necessary, correct the value in C3.

However, when I looked around I couldn't find out how to do this. All I could find was that I could make it start a macro when I save the spreadsheet and things like that, not when changing a specific call.


Is this impossible or did I miss something? If not possible in 1.1.5, is it possible with 2.0?

I have not done a lot with listeners, but that is what you need if you want to call a macro for this. It is also possible to apply certain conditions to cells and let calc take care of it for you (depending on the conditions that you want to enforce). I have only done this using macros and it uses the TableValidation service. It is very flexible, but i have never used it outside of macros. I document it in my book. If you can solve your problem using the validation, it is likely to be more efficient than writing your own macro to do this. Perhaps you can figure out how to do this from the GUI.

--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
My Book: http://www.hentzenwerke.com/catalog/oome.htm
Info:  http://www.pitonyak.org/oo.php
See Also: http://documentation.openoffice.org/HOW_TO/index.html

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

Reply via email to