getting color of a cell in VB

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mohanprasadgutta
    New Member
    • Dec 2007
    • 33

    getting color of a cell in VB

    Hello everybody,
    I am facing problem in read color of a cell.
    problem description is as follows.
    for a particular cell by default colorindex = 35 is provided.
    but that cell is conditional formatted cell.
    The color of the cell will change based on the condition.
    later color of the cell is changed to color red (colorindex = 3)
    my intension is to read that cell color.
    when i tried to read that cell color by using
    activecell.inte rior.colorindex it is giving 35. but it should give 3

    Thanks in advance.

    Kind Regards,
    Mohan.
  • ubentook
    New Member
    • Dec 2007
    • 58

    #2
    One way is to test for the condition instead of trying to determine the color...

    Select Case Range("A1").Val ue
    Case >100
    'do something
    Case > 50
    'do it
    Case > 0
    'etc
    Case Else
    'eat lunch
    End Select

    Comment

    Working...