Consulting

Results 1 to 5 of 5

Thread: Solved: Format certain cells in a worksheet

  1. #1

    Solved: Format certain cells in a worksheet

    i have my sheet highlighted in different colors

    I want to be able to format a row or a column except certain cells
    is that possible

    If not how can I write a code that says something like this

    if column F=P then highlight cells F,G,H,I,J,K a certain color like yellow
    & if cells in column B=1 then hightlight cells F,G,H,I,J,K a certain color like pink
    if cells in column B=2 then hightlight cells F,G,H,I,J,K a certain color like blue
    & so on

    how can I start
    any where would be great as record acro doesnt help really

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Quote Originally Posted by almouchie
    i have my sheet highlighted in different colors

    I want to be able to format a row or a column except certain cells
    is that possible

    If not how can I write a code that says something like this

    if column F=P then highlight cells F,G,H,I,J,K a certain color like yellow
    & if cells in column B=1 then hightlight cells F,G,H,I,J,K a certain color like pink
    if cells in column B=2 then hightlight cells F,G,H,I,J,K a certain color like blue
    & so on

    how can I start
    any where would be great as record acro doesnt help really
    You don't need VBA.

    Select cells F,G,H,I,J,K in a row, let's say row 2
    Menu Format>Conditional Formatting
    Change Condition 1 to Formula Is
    Add a formula of =$F2=$P2
    Click the Format button
    Select the Pattern Tab
    Select pink
    OK

    Second condition

    Click Add
    Change Condition 2 to Formula Is
    Add a formula of =$B2=1
    Click the Format button
    Select the Pattern Tab
    Select yellow
    OK

    Third condition

    Click Add
    Change Condition 3 to Formula Is
    Add a formula of =$B2=2
    Click the Format button
    Select the Pattern Tab
    Select blue
    OK
    OK

  3. #3
    thanks for ur prompt reply
    I thought there must be a way in excel without using codes
    i will try it now
    it will help a lot

  4. #4
    it is not working

    what am i doing wrong
    for the first condition I want yellow color if column F has a value of P
    where p is a letter stands for paid
    i changed formula to =$F2=P
    still didnt work

  5. #5
    thanks it worked out

Posting Permissions

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