I'm using LibreOffice 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?

2 Answers 2

  • 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.


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.

  • Pretty good, but it wipes out the color in the box where (ROW()/4=INT(ROW()/4)).
    – Chelmite
    Feb 2, 2013 at 1:10
  • I'm not sure I follow. If the font color and background color are set in the cell style, then they are maintained.
    – W_Whalley
    Feb 2, 2013 at 14:54
  • 1
    Your conditional formula can be simplified a little, to MOD(ROW(),4)=0. Oct 25, 2015 at 23:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .