| View previous topic :: View next topic |
| Author |
Message |
jsx General User

Joined: 20 Dec 2005 Posts: 5
|
Posted: Wed Jul 12, 2006 10:06 am Post subject: Enable Alternating Row Colors |
|
|
| Is there a way to set up automatic Alternating Row Colors? I know I can manually hold down the ctrl key, select the row number, choose the background color and have the white/gray alternating rows that I want. BUT ... what if I need to insert a new row into the middle of my spread sheet later on?? I have to re-do all the colors?? Can someone help me? Maybe a theme? Maybe a Style? |
|
| Back to top |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 7649 Location: Germany
|
Posted: Wed Jul 12, 2006 3:11 pm Post subject: |
|
|
You find customizable themes under Menu:Format>Auto Format...
One of the predefined auto-formats ("Yellow") alternates the background color of each second row. This will be done by hard formatting and bloats your file. Another problem is the insert-cells-problem you mentioned.
Format your sheet (or a blank one) as you like.
call stylist(F11)
For each type of formatted cell:
- Highlight cell: Ctrl+Click
- Drag to stylist
- Give a style name ("row_header","row_even","row_odd" or alike)
Select the range and call Menu:Format>Auto Format...
Notice the extra-options
Add new ...
Close
Now you have a new auto-format and when you insert a row, you just have to highlight and doubleclick a style-name. Or you may select the entire list-range and redo auto-formatting. (The latter has a nice side-effect: You can see, where you have inserted rows before you re-format.)
OK, let's do more with your named styles "row_even" and "row_odd".
Select your current list without headers (I assume A2:F100)
Notice which cell has the focus (I assume A2)
Type some name into the name-box left of formula-bar (I assume myList, no spaces allowed)
Remove all formatting (Del-key): Check formatting only.
Call Menu:Format>Conditional ...
Choose "Formula" for condition1
Formula: AND(NOT(ISERROR(A2!myList));MOD(ROW(A2);2)=1)
Style: "row_odd"
Choose "Formula" for condition2
Formula: AND(NOT(ISERROR(A2!myList));MOD(ROW(A2);2)=0)
Style: "row_even"
From the viewpoint of currently active cell A2 this will apply "row_odd" if A2 is in myList (intersection of A2 and myList is not an error) and if the row-number of A2 divided by 2 has residue 1.
From the viewpoint of currently active cell A2 this will apply "row_even" if A2 is in myList (intersection of A2 and myList is not an error) and if the row-number of A2 divided by 2 has residue 0.
If A2 is not in myList, the cell's formatting won't change.
Since named reference myList is an absolute reference ($sheetName.$A$2:$F$100)and A2 is a relative one, the conditional formatting of B4 will be:
Formula: AND(NOT(ISERROR(B4!myList));MOD(ROW(B4);2)=0)
Insertion of rows and columns adjusts the size of myList. _________________ XUbuntu 9.04, OOo 3.1.1(Sun), Sun Java 1.5.0_06 |
|
| Back to top |
|
 |
Dale Super User

Joined: 21 Feb 2005 Posts: 1445 Location: Australia
|
Posted: Wed Jul 12, 2006 3:12 pm Post subject: |
|
|
Try selecting the range of interest and
Format > AutoFormat
If none of those options are what you want, you can use Conditional Formatting with ISEVEN(ROW()) as the condition. You will need to create appropriate cell styles first. See How to apply Conditional Formatting to a Cell for details. (It's a quick read with screen shots to make things clear)
+ + + + +
Villeroy and I posted at about the same time. I didn't know you could create your own AutoFormats. _________________ Dale
To err is human, but to destroy your slippers in the process takes a real son of a bitch: Me!
OOo documentation from the source
http://documentation.openoffice.org
Guides, FAQ, How Tos |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|