Ask Your Question

In Calc, I need to push a button and have a cell value making 1, how do I do it,

asked 2017-08-31 01:23:33 +0200

P35Sports gravatar image

In Calc, I need to push a button and have a cell value making 1, how do I do it?

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2017-09-01 16:38:38 +0200

P35Sports gravatar image

Thank you again for the prompt answer. I Always worked with normal formulas and sheets, but I am really not good with macros. I keep trying, and I try to learn as well but I really have troubles to write a macro for this thing (even if probably what I need to do is really easy)

edit flag offensive delete link more

answered 2017-08-31 02:24:55 +0200

Regina gravatar image

Here a workaround without macro: You can make a fake button by using a check-box and an image.

  1. View > Toolbars > Form Controls. Insert a check box.
  2. Right-click the check box > Control...
  3. In tab Data enter the cell address e.g. B2 in field Linked cell
  4. In tab General go to field Graphics. Click on the ... button and select an image.

The entire area of the control is click-sensitive. You only need to design a graphic, which looks like a button.

The value in the linked cell will toggle between TRUE and FALSE with each click. LibreOffice has no separate logical data type but interprets TRUE as 1 and FALSE as 0 in Spreadsheets formulas.

If you need other values in the linked cell, you can set it in tab Data in the fields Reference value (on) and Reference value (off). But it is always a text, even if you enter 1 and it looks like a number.

For a true Push Button you need a macro, that writes the value into the cell. You can then bind the macro e.g. to the "Execute action" event in the tab Events.

edit flag offensive delete link more


Thank you! This works if I want the cell to add +1? I mean the cell value is 3, when I push the button the cell need to become 4, then 5,...

I would like to make my sports stats (shots,...)

P35Sports gravatar imageP35Sports ( 2017-08-31 09:58:56 +0200 )edit

For that you really need a macro. The normal behavior of a spreadsheet is, that the formulas in the cells pull the values from other cells. You cannot push a value into a cell.

Regina gravatar imageRegina ( 2017-08-31 22:39:32 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-08-31 01:23:33 +0200

Seen: 1,685 times

Last updated: Sep 01 '17