Consulting

Results 1 to 4 of 4

Thread: Conditional formatting according to range

  1. #1

    Conditional formatting according to range

    Hello,

    I am trying to apply a background color (yellow) for any cells in the range c12:c511 if any of the cells within each row (range a:ch ) is blank then the cell in column c turns yellow. For ex: If any cell from a12:CH12 is blank, then c12 turns yellow. This would be applied to each row until c511 is reached. Is there any way to do this for all rows with VBA code instead of having to apply a specific conditional formatting through the "manage rules" section of excel. Any help would be appreciated.

    Thanks,

    Pablo

  2. #2
    VBAX Expert CatDaddy's Avatar
    Joined
    Jun 2011
    Posts
    581
    Location
    [vba]For each cell in Range("A12:CH512")
    If cell.value = "" Then cell.Interior.ColorIndex = 6
    Next cell[/vba]
    ------------------------------------------------
    Happy Coding my friends

  3. #3
    Thanks! Where do I enter the code and/or is there anything I have to type before it to activate it?

  4. #4
    Quote Originally Posted by pbobadilla
    Thanks! Where do I enter the code and/or is there anything I have to type before it to activate it?
    Do I set it up as an event? Prodcedure? or module?

    Thanks,

Posting Permissions

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