[Solved] How to add check box to column cell?

Discuss the spreadsheet application
Post Reply
JimTrail
Posts: 26
Joined: Sat May 09, 2009 6:47 pm

[Solved] How to add check box to column cell?

Post by JimTrail »

Hello Open Office Community Forum!

Question: How can I insert a check box into a column cell?

I have got a monthly sales spreadsheet. I need to have one column where every cell has a check box.

I would appreciate any assistance with my question.

Thanks.
Last edited by Hagar Delest on Thu Feb 13, 2014 3:24 pm, edited 1 time in total.
Reason: tagged [Solved].
64-bit, Windows 7, Open Office 4.1.1
User avatar
squenson
Volunteer
Posts: 1885
Joined: Wed Jan 30, 2008 9:21 pm
Location: Lausanne, Switzerland

Re: How to add check box to column cell?

Post by squenson »

This is an interesting idea but not easy to do. You can only create checkboxes one at a time using the toolbar "Form Control".

It is much better to store a real value in such cell (1|0, Yes|No, True|False), you will then be able to filter, sort, sum, etc. according to the value in this column. And if you need to absolutely show the nice little square box in a print-out, then add a new column and use a formula like =IF(mycell="Yes",symbol 'tick', symbol 'untick').
LibreOffice 4.2.3.3. on Ubuntu 14.04
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: How to add check box to column cell?

Post by acknak »

I think it would be a really nice enhancement if calc could flip cells formatted as Boolean (T/F) with just a mouse click. The cell value could toggle between 0/1 and you could assign a custom format that could display a blank "" or "X" or whatever.

Hmm ... Ugh. I guess that's the problem, isn't it? Calc doesn't have a separate Boolean type, so it has no way to know whether a cell or column is Boolean or numeric.

Oh well.
AOO4/LO5 • Linux • Fedora 23
User avatar
lino
Volunteer
Posts: 312
Joined: Thu Mar 28, 2013 11:16 am
Location: http://goo.gl/maps/rsfPZ

Re: How to add check box to column cell?

Post by lino »

Here is my suggestion:
viewtopic.php?f=9&t=64017#p283980
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: How to add check box to column cell?

Post by acknak »

Yep, that's what I had in mind--nice! But it really needs to be set/unset with a simple click.

I'm sure it could be done with a macro, but someone else can fiddle with that ;-)
AOO4/LO5 • Linux • Fedora 23
User avatar
MrProgrammer
Moderator
Posts: 4935
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: How to add check box to column cell?

Post by MrProgrammer »

acknak wrote:I'm sure it could be done with a macro, but someone else can fiddle with that ;-)
It can be easily done with a recorded macro, so no programming knowledge is required. After ensuring that we have option (OpenOffice.org > Preferences on a Mac, Tools > Options on other platforms) Calc > General > Input Settings > Press Enter to move selection unchecked, use
  • Tools > Macros > Record
  • Edit > Copy
  • Type 1 and press Enter
  • Edit > Paste Special > Selection=Values > Operation=Subtract > OK
  • Stop Recording > {Assign name to macro, perhaps "Toggle"}
Tools > Customize > Keyboard can be used to map a keyboard shortcut to this macro. If Press Enter to move selection is checked, you will need to record an additional step before Paste Special to move the selection back to the cell to be toggled.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
JimTrail
Posts: 26
Joined: Sat May 09, 2009 6:47 pm

Re: How to add check box to column cell?

Post by JimTrail »

Thanks everyone for the help.
64-bit, Windows 7, Open Office 4.1.1
Post Reply