Click here to reset your password. You MUST have a valid e-mail address so that you may receive the instructions to complete the reset.

If this is your first visit, be sure to check out the Board FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.

I'm looking for the code to shade the interior of each odd numbered row to colorindex=15. Right now I go line by line with a manual counter that changes from 0 to 1 or 1 to 0 at the end of each run of the loop. There's got to be a more efficient way to do this. Any suggestions?

(1) Click on Format > Conditional Formatting.
(2) In the first drop down box, select "Formula Is"
(3) In the field at the right of that, enter
=MOD(ROW(),2)=1
(4) Click the Format button, then Patterns tab.
(5) Color index 15 is light gray, so choose that and hit OK, OK.

Thinking about your question and my response, you asked for code but I gave you a non-code answer because you also asked for efficiency. Loops tend to be inefficient, but so might a large range that is conditionally formatted. There're pros and cons with either approach; it depends on your preference and spreadsheet design.