+ Reply to Thread
Results 1 to 6 of 6

Conditional formatting to colour rows/columns

  1. #1
    Registered User
    Join Date
    11-06-2006
    Posts
    5

    Conditional formatting to colour rows/columns

    I'm having troubles trying to colour my cells so that all the even-numbered cells are yellow and the odd cells are white.

    All the tutorials I've seen only show me how to make a formula so that a cell is a certain colour if the data in it is high, low, more than, less than, etc.

    How can I format my table so that even and odd rows/columns are just a certain colour?

  2. #2
    Forum Contributor
    Join Date
    06-10-2004
    Location
    India
    Posts
    1,066
    Select all the cells, go to conditional format, select FORMULA IS, and enter the formula:
    =mod(row(),2)=0

    choose the required format color (yellow) by clicking on format button, pattern.
    Mangesh

  3. #3
    Forum Contributor
    Join Date
    06-10-2004
    Location
    India
    Posts
    1,066
    Select all the cells, go to conditional format, select FORMULA IS, and enter the formula:
    =mod(row(),2)=0

    choose the required format color (yellow) by clicking on format button, pattern.

  4. #4
    Registered User
    Join Date
    11-06-2006
    Posts
    5
    Thanks, the formula works perfectly.

    However, if I wanted to change it so that the ODD-NUMBERED cells are coloured, how to I alter the formula?

    Also, how do I do this with columns?

  5. #5
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    Try

    =MOD(ROW(),2)=1

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  6. #6
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Sorry,

    To do columns try

    Start in Col A
    =MOD(Column(),2)=1

    or

    to start in Col B

    =MOD(Column(),2)=0

    VBA Noob

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1