Consulting

Results 1 to 11 of 11

Thread: Solved: go through column and highlight cells

  1. #1
    VBAX Mentor
    Joined
    Oct 2007
    Posts
    372
    Location

    Solved: go through column and highlight cells

    The goal is to go through a column and if the number is say over or under .1 to high light in red (or any color for that matter).

    How do you step through each cell going down a column?

  2. #2
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    Hi there,

    Not sure what you mean. Conditional Formatting will take care of it though. If you need more information, so do we.

  3. #3
    VBAX Mentor
    Joined
    Oct 2007
    Posts
    372
    Location
    I have a spreadsheet with a column x with data in some rows from 1 to 2000. What I'm trying to do is go through those 2000 rows and if there is data in them and the value is greater than .1, put fill.color to red. What else would be helpful?

  4. #4
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    Do you not want to use Conditional Formatting?? This is what you need. If you need more, describe your data in great detail, or post a sample file.

  5. #5
    VBAX Mentor
    Joined
    Oct 2007
    Posts
    372
    Location
    Here's a sample file. I've tried using conditional formatting but I can't get it to treat blanks, div/0, etc correctly. I'm trying to only pick up the values for color when there's an actual value there in the % column. My original thought was to just step through the column cell by cell and evaluate each one then change fill color as the criteria dictate.

    thanks

  6. #6
    VBAX Mentor
    Joined
    Oct 2007
    Posts
    372
    Location
    I should say to pick up values in the case of the sample file > abs(.1)

  7. #7
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,445
    Location
    A CF formula of

    =AND(B3<>"",B3<0.1)

    works for me
    ____________________________________________
    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

  8. #8
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    But in your example, all values fall into the less than -1% or greater than 1% range. Select the entire column H, add conditional formatting formula of ...

    =($A1<>"")*(ISNUMBER($H1))*(($H1<-0.01)+($H1>0.01))
    Edit: Is it 0.1%, or 0.1?

  9. #9
    VBAX Mentor
    Joined
    Oct 2007
    Posts
    372
    Location
    Quote Originally Posted by firefytr
    But in your example, all values fall into the less than -1% or greater than 1% range. Select the entire column H, add conditional formatting formula of ...

    =($A1<>"")*(ISNUMBER($H1))*(($H1<-0.01)+($H1>0.01))
    Edit: Is it 0.1%, or 0.1?
    .1 or 10 %

  10. #10
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    Ok, then adjust the numbers accordingly...

    =($A1<>"")*(ISNUMBER($H1))*(($H1<-0.1)+($H1>0.1))

  11. #11
    VBAX Mentor
    Joined
    Oct 2007
    Posts
    372
    Location
    roger -- thanks for the help

Posting Permissions

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