+ Reply to Thread
Results 1 to 2 of 2

Comparing Fill Color

  1. #1
    Registered User
    Join Date
    03-27-2005
    Posts
    13

    Comparing Fill Color

    Is there a way for me to determine the current fill color of a cell?

    For example if the cell is red filled, I do not want to change the color. But if it is any other color, I would would overlay with a color.

    I'm using VBA to comparing 2 fields values and then color filling another based on the result. The code works fine but I do not want RED fill to be overlaid.

  2. #2
    Gary''s Student
    Guest

    RE: Comparing Fill Color

    Enter this small UDF:

    Function clr(R As Range) As Integer
    With R.Interior
    clr = .ColorIndex
    End With
    End Function

    Use it like =clr(A1). It will return a number corresponding to the
    interior color of A1
    --
    Gary''s Student


    "magoobee" wrote:

    >
    > Is there a way for me to determine the current fill color of a cell?
    >
    > For example if the cell is red filled, I do not want to change the
    > color. But if it is any other color, I would would overlay with a
    > color.
    >
    > I'm using VBA to comparing 2 fields values and then color filling
    > another based on the result. The code works fine but I do not want RED
    > fill to be overlaid.
    >
    >
    > --
    > magoobee
    > ------------------------------------------------------------------------
    > magoobee's Profile: http://www.excelforum.com/member.php...o&userid=21581
    > View this thread: http://www.excelforum.com/showthread...hreadid=478811
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1