Results 1 to 5 of 5

Macro to validate a condition and change cell color

Threaded View

  1. #1
    Registered User
    Join Date
    07-09-2010
    Location
    Delhi NCR, India
    MS-Off Ver
    Excel 2003
    Posts
    46

    Macro to validate a condition and change cell color

    Hi,

    Can someone help me with the below code. I want the macro to validate the following two conditions and if both the the conditions are met it should change the cell color format to White.

    Conditions are:
    1. If Cel.Interior.ColorIndex = 50
    2. And If Cel.Value is Not Equal to "(blank)"

    Then it should change the Cell Color to White. I have written the following code but its not working. Please help. Thanks.

        For Each Cel In Range(Range("D6"), Range("D" & Range("B" & Rows.Count).End(xlUp).Row))
            If Cel.Interior.ColorIndex = 50 And Cel.Value Is Not "(blank)" Then
                Cel.Interior.ColorIndex = 2
    Last edited by kapil; 08-03-2010 at 10:10 AM.

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