Ask Your Question
0

automate clearing cell contents?

asked 2012-04-05 16:56:02 +0200

GuitarEC gravatar image GuitarEC
11 1 3

updated 2013-02-01 16:55:26 +0200

qubit gravatar image qubit flag of United States
5816 3 50 43

I have built a spreadsheet form for work for use by the employees. Because it takes so long to launch LibreOffice, I'm being asked to make a (Clear Form) button on the form. Is there some sort of function I can use to do this? If not, could someone offer a possible alternative?

Thanks,

Eric "GuitarEC"

delete close flag offensive retag edit

1 Answer

Sort by » oldest newest most voted
0

answered 2012-04-05 19:49:45 +0200

luyu gravatar image luyu
1038 1 8 14

Open document, then go to Tools -> Options -> LibreOffice -> General and check "Enable experimental (unstable) features". A new option Tools -> Macros -> Record Macro will show up. Once you click on it macro recording will start, so make sure you only do what you want to be done every time you start that macro later, which is, if I understood correctly, deleting contents of some cells. Select those cells, if you want you can hold and drag the mouse over them in case they are connected or pick individual cells holding Ctrl and clicking on them one by one. Once you do that press Delete key to clear them and when you finish click on "Stop Recording" button. A dialog will show asking you to save newly created macro. If you want to use it only in current document, save it under that document's filename in the list, entering appropriate name for the macro. Now you can start it by going to Tools -> Macro -> Run Macro.

But there is a way to make it more comfortable for users. Open View -> Toolbars -> Form Controls, click on "Push Button" in that toolbar and add it to a suitable location in a document. Right-click on that button and select "Control", open "Events" tab, and click on "..." next to "Execute action". When "Assign action" dialog appears, make sure "Execute action" is selected, then click on "Macro..." and add the one you recorded. After confirming opened dialogs, click on "Design Mode On/Off" button in the Form Controls Toolbar to exit Design Mode. Now you can do what you wanted by clicking on a newly created Push Button. Save the document.

link delete flag offensive edit

Login/Signup to Answer

Donate

LibreOffice is made available by volunteers around the globe, backed by a charitable Foundation. Please support our efforts: Your donation helps us to deliver a better product!

Question tools

Follow

subscribe to rss feed

Stats

Asked: 2012-04-05 16:56:02 +0200

Seen: 428 times

Last updated: Apr 05 '12