Only run macro on manually edited fields
Only run macro on manually edited fields
I am attempting to set up an inventory control spreadsheet with several levels of sub-assemblies between the base components and finished products. I have figured out most of what I need so far, but was wondering if there is any way to check if a field was edited manually, as it seems that "content changed" fires whenever anything changes and I would rather not have things propagate further than I plan.
Last edited by David_L on Wed Feb 12, 2025 11:37 am, edited 5 times in total.
LibreOffice 24.2 on Manjaro
Re: Only run macro on manually edited fields
You can use Data Validity to trigger a macro. For each cell, choose the menu Data -> Validity. Set the criteria to be a Text Length less than or equal to zero. On the Error Alert tab, set the Action to Macro and use the Browse button to choose the macro. With those settings, entering anything in the cell will trigger the macro.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Re: Only run macro on manually edited fields
Any idea why ActiveCell.Copy is grabbing the old value rather than the edited one?
Edit: Looks like the validator, and thus the macro, runs before the cell is updated. I was honestly hoping there would be something I could simply check with an if statement.
LibreOffice 24.2 on Manjaro
Re: Only run macro on manually edited fields
Let's take a step back. What are you trying to achieve with the macro? Maybe there is another, simpler approach.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Re: Only run macro on manually edited fields
I've changed a few things since my initial question, and in a way it almost no longer applies. I am now planning, again, to use the Sheet event > content changed trigger to watch specific columns and run the appropriate macros from there.
I have attached an example document, the process I would be using begins on the Assemblies page in column D.
Edit: As I seem to be unable to attach files at the moment here is a link to it. http://filehost.loretracker.net/Invento ... xample.ods
I have attached an example document, the process I would be using begins on the Assemblies page in column D.
Edit: As I seem to be unable to attach files at the moment here is a link to it. http://filehost.loretracker.net/Invento ... xample.ods
| Edit: File attached, since filehost.loretracker.net link may break -- MrProgrammer, forum moderator |
LibreOffice 24.2 on Manjaro
Re: Only run macro on manually edited fields
The structure of your document suggests that a database would be more efficient.
So use Base instead of Calc.
So use Base instead of Calc.
Co-admin french forum branch