In LibreOffice Calc, how can I use the fill handle to copy formulae, but not the cell/border formatting?

I'm using LibreOffice 3.6.4.3 on Ubuntu 12.10 (Quantal Quetzal).

I use cell color and cell borders to group and distinguish groups of cells in my spreadsheet.

I have bold horizontal borders every four rows. This is a pain to do, because you can't specify "embolden the borders on every nth row". So I do it manually, for enough of the spreadsheet as I need to deal with.

I'm developing the spreadsheet, so I modify the formulae frequently. When I get the formula working for a cell, I propagate that formula to a bunch of rows below by dragging the cell's fill handle down to the other (several hundred) rows. The problem is that dragging the fill handle copies the cell formatting from the source cell(s) as well as the formula(e). This undoes the emboldened borders on every fourth row and re-colors all the cells too. I then have to select a group of four rows of cells and manually embolden the top and bottom borders for each group of four rows. It's very tedious.

Is there a way to drag the fill handle and propagate the formula(e), but not the cell formatting?


Solution 1:

  • Copy your new formula
  • Select every cell where the new formula needs to be
  • Right click, and in the popup menu, select "Paste Only >> Formula"

This preserves your cells' color, border, etc.

Solution 2:

You can do this using conditional formatting.

First, define a new cell style for your underlined cells, e.g., Underlined. Then pick a cell and define a conditional format (Format->Conditional Formatting). For Condition 1, pick Formula is, and in the formula box enter "(ROW()/4=INT(ROW()/4))" (without the quotes). Choose the cell style to be Underlined. This is true only every 4th row.

Copy the cell (Ctrl+C), select the area you want to modify and Paste Special (Ctrl+Shift+V). Clear all the check boxes in the selection section except the Formats box and complete the copy. Or even easier, use the format painter.

You should now be able to click and drag a formula through those boxes without affecting your underline formatting.