Automatic Coloring of Odd and Even Rows

From NeoWiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 15:43, 30 January 2008 (edit)
Jgd (Talk | contribs)
(New page about automatic coloring of rows in Calc)
← Previous diff
Revision as of 15:47, 30 January 2008 (edit) (undo)
Jgd (Talk | contribs)
(add fixme (English is not yet polished))
Next diff →
Line 1: Line 1:
-Automatic Coloring of Odd and Even Rows+{{Fixme}}
You can format a spreadsheet to alternate the row background color of a cell range. To do that, you need to create a style for each color, then to use the ''conditional formating''. You can format a spreadsheet to alternate the row background color of a cell range. To do that, you need to create a style for each color, then to use the ''conditional formating''.

Revision as of 15:47, 30 January 2008

This article is not up to date, or it needs structural or stylistic changes to conform with the rest of this wiki.

You can format a spreadsheet to alternate the row background color of a cell range. To do that, you need to create a style for each color, then to use the conditional formating.

Creating the Style

  • Open a new spreadsheet.
  • Select a cell.
  • Go to the Format menu and select Cells….
  • In the Format Cells window that appears, click on the Background tab.
  • Choose the color you desire and click OK.
  • This cell being still selected, go to the Format menu and select Styles and Formatting.
  • In the Styles and Formatting window, click on the New Style from Selection icon (the second icon from the right).
  • In the dialog that opens, give this style a name, for example OddRow.
  • Repeat these steps with a second cell and call the style EvenRow.

Conditional Formatting

  • Select the whole page by pressing the Command-A keys, or only the range you want to be formatted this way.
  • Go to the Format menu and select Conditional Formatting….
  • In the Conditional Formatting window, in the Condition 1 section, choose Formula is in the drop-down menu and enter
ISODD(ROW())
in the text box.
  • Enter OddRow in the drop-down menu of the Cell Style section.
  • Check the Condition 2 box.
  • Choose Formula is in the drop-down menu and enter
ISEVEN(ROW())
in the text box.
  • Enter EvenRow in the drop-down menu of the Cell Style section.
  • Click OK.
This will apply automatically if you insert or delete rows in the cell range.



Three Different Colors

The conditional formatting allows you to set three conditions. Thus you can apply this method to three rows. Let us suppose that you have created three styles called Row1, Row2 and Row3.

  • Select the whole page by pressing the Command-A keys, or only the range you want to be formatted this way.
  • Go to the Format menu and select Conditional Formatting….
  • In the Conditional Formatting window, in the Condition 1 section, choose Formula is in the drop-down menu and enter the formula
MOD(ROW();3)=1
  • Enter Row1 in the drop-down menu of the Cell Style section.
  • Check the Condition 2 box.
  • Choose Formula is in the drop-down menu and enter the formula
MOD(ROW();3)=2
  • Enter Row2 in the drop-down menu of the Cell Style section.
  • Check the Condition 3 box.
  • Choose Formula is in the drop-down menu and enter the formula
MOD(ROW();3)=0
  • Enter Row3 in the drop-down menu of the Cell Style section.
  • Click OK.


This article in other languages: Français
Personal tools