Consulting

Results 1 to 5 of 5

Thread: Highlighting alternate rows

  1. #1
    VBAX Regular
    Joined
    Sep 2004
    Location
    Sydney, Australia
    Posts
    34

    Highlighting alternate rows

    Hi
    I have a fairly large data spreadsheet (8 sheets) and want Excel to

    automatically color in every alternate row in colorcode 34 for ease of

    reading. However, some of the columns are already coloured in other

    colors based on their cell values. I need these colors to be superior

    to the row color 34. I tried the following Cond Formating way, but the

    row color takes superiority...How do i change this? I need the cell value color to be superior

    =AND(MOD(ROW(),2),COUNTA($a5:$R200))

    Suju


    Land Down-Under... Over the Hill and Farrrr Away.

  2. #2
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    Are the other cells colored with Conditional Formatting as well? If so, make sure that the format you want to take priority is listed ahead of the other formats. If the first Conditional Format is True, that format will be applied and the other two Conditional Formats will not be checked.

  3. #3
    VBAX Regular
    Joined
    Sep 2004
    Location
    Sydney, Australia
    Posts
    34
    Hi DrJ
    No, the other cells are colored based on their numeric value through the Workbook_Open event.....(thats what i am trying to achieve anyways)

    thanks.
    Suju
    Suju


    Land Down-Under... Over the Hill and Farrrr Away.

  4. #4
    VBAX Master TonyJollans's Avatar
    Joined
    May 2004
    Location
    Norfolk, England
    Posts
    2,291
    Location
    Conditional Formatting will always take precedence over other formatting so, if I understand correctly, you can't do what you're trying (in the way that you're trying it).
    Enjoy,
    Tony

    ---------------------------------------------------------------
    Give a man a fish and he'll eat for a day.
    Teach him how to fish and he'll sit in a boat and drink beer all day.

    I'm (slowly) building my own site: www.WordArticles.com

  5. #5
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    You could create a UDF like so

    [VBA]
    Function coloured(cell As Range)
    coloured = cell.Interior.ColorIndex <> xlColorIndexNone
    End Function
    [/VBA]

    and change your CF formula to

    =AND(MOD(ROW(),2),COUNTA($A5:$R200),NOT(COLOURED(A5)))

    I am assuming the CF starts in A5.

    .
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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