Macro To Shade Every Other Row

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have the following Range: "A10:Z2000". I am trying to figure out some
code that would allow me to begin with row 10 within the range, and highlight
every other row with a light shade of grey until it reaches the end of the
range. Some of the cells will have other formats in place (Number,
Percentage, etc), so I would want the shading to occur with the existing
formats remaining in place. Can anyone help. Thanks.

Jason
 
Without a macro, use conditional
formatting>condition1>=mod(row(),2)=0>format patterns gray>copy the format.
easier when you add and delete
 
One way to make your data legible is to apply cell shading to every
other row in a range. Excel's Conditional Formatting feature
(available in Excel or later) makes this a simple task.

Select the range that you want to format

Choose Format, Conditional Formatting

In the Conditional Formatting dialog box, select Formula Is from the
drop-down list, and enter this formula:

=MOD(ROW(),2)=0.

Click the Format button, select the Patterns tab, and specify a color
for the shaded rows.

Click OK twice to return to your worksheet.

The best part is that the row shading is dynamic. You'll find that the
row shading persists even if you insert or delete rows within the
original range.
 
One way to make your data legible is to apply cell shading to every
other row in a range. Excel's Conditional Formatting feature
(available in Excel or later) makes this a simple task.

Select the range that you want to format

Choose Format, Conditional Formatting

In the Conditional Formatting dialog box, select Formula Is from the
drop-down list, and enter this formula:

=MOD(ROW(),2)=0.

Click the Format button, select the Patterns tab, and specify a color
for the shaded rows.

Click OK twice to return to your worksheet.

The best part is that the row shading is dynamic. You'll find that the
row shading persists even if you insert or delete rows within the
original range.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top