Ask Your Question

Protecting individual cells in Calc [closed]

asked 2015-02-19 07:17:23 +0200

kootiekiller gravatar image

updated 2020-08-15 23:29:50 +0200

Alex Kemp gravatar image

The current process is way too complicated and cumbersome. How about a simple command like CONTROL + SHIFT + "P" The protected cell could then have some little indicator like dotted or thicker bar grids. Perhaps cells could be protected by a color selection pre-determined in a table option. For example yellow and white cells couldn't be altered but green ones can. Unprotecting the cells could be say CONTROL + SHIFT + "p". Capital P locks the cell and small p unlocks it.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2020-08-15 23:29:59.737173


Excuse me, my friend, do you really think that Shift+P is different from Shift+p? Actually, it does not matter. Since cell only two states - protected and unprotected - repeated pressing the same keys can switch between these states. This task has been repeatedly decided by a simple macros. And highlighting by using conditional formatting on the condition =CELL("PROTECT"; <cell>) also repeatedly implemented.

JohnSUN gravatar imageJohnSUN ( 2015-02-19 07:37:42 +0200 )edit

I add that without conditional formatting, simply switch to "View> Value highlighting" (ctrl + F8): protected cells are grayed out when protection is enabled

pierre-yves samyn gravatar imagepierre-yves samyn ( 2015-02-19 09:22:34 +0200 )edit

Yes, but unfortunately it's work only when sheet is already protected. CF can show cells that will be protected when you will set protection on sheet

JohnSUN gravatar imageJohnSUN ( 2015-02-19 10:08:42 +0200 )edit

@JohnSUN - Of course, but you have nothing to do. The shortcut already exists.

Moreover, the proposed CF can not be "switched" (on / off) easily. The formula should be completed to test "something else" (eg. a cell's content). And it may be in conflict with other formats defined for the range.

That said for my part I only use styles to protect. So I just have to change the color of the "master" style if I want to see the effect.

In short, current feature is perfect for me :)

pierre-yves samyn gravatar imagepierre-yves samyn ( 2015-02-19 13:02:38 +0200 )edit

@pierre-yves samyn Yes, you are absolutely right! The combination of a cell style (which can call with hot key) and Value highlighting - is the best solution. Can you prepare a recommendation step-by-step as the answer to this question?

JohnSUN gravatar imageJohnSUN ( 2015-02-19 20:18:36 +0200 )edit

1 Answer

Sort by » oldest newest most voted

answered 2015-02-20 18:31:55 +0200

pierre-yves samyn gravatar image

Hi - In the ProtectCell.ods attached, formatting and cell protection is achieved by applying styles. Protected areas are:

  • Titles (C1 & A3:D3)
  • Calculated ranges (C4:D9)

When the protection is enabled, use Ctrl + F8 to gray protected cells. To view protected areas when protection is not enabled right click in the Styles Window on "ProtectMaster"> Modify, Background tab, choose a color (Chart3 in the example).

image description

Steps to reproduce this example:

  • Right click "Default" in the Styles Window (Cell styles) > Modify: Unprotect.
  • Create the "master" style (ProtectMaster in the example), Protect
  • Right click on this style > New to create "dependent" styles (ProtectCurrency & ProtectTitles in the example). These styles "inherit" protection as they inherit the color.

This example only protects some cells, others are not (default). It goes without saying that one can do the opposite...

edit flag offensive delete link more


In addition:: You can assign a keyboard shortcut to quickly apply this style. Just choose Tools - Customize - Keyboard tab

JohnSUN gravatar imageJohnSUN ( 2015-02-20 18:55:06 +0200 )edit

Many thanks pierre-yves samyn. Just the help I needed. Downloaded your file and all was clear !

Christopher Whitmey gravatar imageChristopher Whitmey ( 2016-05-10 16:19:26 +0200 )edit

Question Tools



Asked: 2015-02-19 07:17:23 +0200

Seen: 1,785 times

Last updated: Feb 20 '15