Results 1 to 7 of 7

Conditional Formatting using VBA - Code not working properly

Threaded View

  1. #1
    Forum Contributor
    Join Date
    10-21-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    110

    Conditional Formatting using VBA - Code not working properly

    Hi All,

    I have a VBA Code which sets Conditional Formatting for a range.

    But it's not working as it should be.

    Can anybody please have a look at attached file and suggest a solution.

    In the file, only one function is written as below:

    Sub setCondFormat()
        Cells.FormatConditions.Delete
        With Range("B3:H62")
            .FormatConditions.Add Type:=xlExpression, Formula1:="=IF($D3="""",FALSE,IF($F3>=$E3,TRUE,FALSE))"
            With .FormatConditions(.FormatConditions.Count)
                .SetFirstPriority
                .Interior.Color = RGB(215, 228, 188)
            End With
        End With
    End Sub
    Following is the conditional formatting rules in simple english:
    1. If Cell in column D is blank, no formatting should be applied.
    2. If Cell in column F is >= Cell in column E, that whole row should become green.


    Kindly help!
    Attached Files Attached Files
    Last edited by Tejas.T; 12-02-2012 at 05:57 PM.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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