Repost from my old blog so I can refer to this in a new post:
I really thought I had posted this, but I can’t find it. I like when printed Excel sheets have some formatting to let you scan the page easily, and graybar (or greenbar) is usually the best way to format. If you just need something very simple, probably the easiest way to get graybar in Excel is to use Conditional Formatting. Here’s what you do:
- Select the range you want formatted
- Click Format | Conditional Formatting…
- Change the dropdown to “Formula Is”
- Type in the formula:
=MOD(ROW(), 2) = 0
- Click the “Format…” button and set your formatting – background color is on the Patterns tab, but you can apply any formatting you want… bold, outline, etc.
This will apply the formatting to even rows and not odd rows. If you add or remove rows, the formatting will adjust because it’s based on the row number. If you need the ODD rows to have the formatting, the formula is
MOD(ROW(), 2) = 1. You can even click the “Add >>” button and use both formulas to apply different formatting to both even and odd rows.