Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    Oct 2004
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Alternate color rows (Excel XP)

    Coloring alternate rows can be done with conditional formatting and is not too difficult. However instead of coloring every other line or every fourth line, is it possible to select a block and color the first four rows one color, then skip four rows and color the next four? Thus the color scheme goes four on and four off.

    One of the auto-format options uses a two on, two off style. (I believe it is "List 2"). Can this be easily adjusted?

  2. #2
    3 Star Lounger Jim Cone's Avatar
    Join Date
    Feb 2002
    Location
    Portland, Oregon, USA
    Posts
    238
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Alternate color rows (Excel XP)

    The free Excel add-in "Shade Data Rows" can shade by...
    cell value
    every nth row
    every group of rows of nth size

    Download from ... http://www.realezsites.com/bus/primitivesoftware
    No registration required.

    Jim Cone
    San Francisco, USA

  3. #3
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Vancouver, Br. Columbia, Canada
    Posts
    268
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Alternate color rows (Excel XP)

    Sure.

    In the usual case, when you are colouring every "Nth" row, you test for <font color=blue>MOD(RowNum, N) = 0</font color=blue> - in this case, test for <font color=blue>MOD(RowNum,8) <4</font color=blue>. The actual formula in the conditional formatting test would be:
    <pre>=(MOD(CELL("row",E5),8) < 4)</pre>


    In fact, this will leave the first three rows uncoloured, then begin alternating 4-row blocks. If you really need to get the first four uncoloured, use
    <pre>=(MOD(CELL("row",E5) - 1,8) < 4)</pre>


  4. #4
    New Lounger
    Join Date
    Oct 2004
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Alternate color rows (Excel XP)

    Thank you very much to both responders. The addin worked with the benefit of a graphical interface. The formula for conditional formatting also worked exactly as stated. I will puzzle over the formula to try to understand exactly how it works. <img src=/S/dizzy.gif border=0 alt=dizzy width=15 height=15> The details in the help file were too minimal to even suggest how to do this.

    Thanks again.

  5. #5
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Alternate color rows (Excel XP)

    Hi Dean,
    As a matter of interest, why do you use:
    <code>CELL("row",E5)</code>
    rather than just:
    <code>ROW(E5)</code>?
    Regards,
    Rory

    Microsoft MVP - Excel

  6. #6
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Vancouver, Br. Columbia, Canada
    Posts
    268
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Alternate color rows (Excel XP)

    Ummm....

    Because until two minutes ago, I didn't know that the "ROW()" function existed...

    Old dog; new trick!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •