Results 1 to 4 of 4

Conditional Formatting not applying

Threaded View

  1. #1
    Registered User
    Join Date
    06-19-2013
    Location
    Townsville, QLD
    MS-Off Ver
    Excel 2003
    Posts
    2

    Conditional Formatting not applying

    Hi There,

    I am having great difficulties with my conditional formatting. I have two columns that need to be compared - "C" is a static value while "E" is calculated by user input in another sheet.
    I am using the condition =IF(E5<C5,1,0) ***E5 turns red if less than C5*** applied to "E5:E27", however C5 keeps changing to #REF! and it doesn't apply.
    The sheet is protected so I tried to unprotect it in vba but it still wont apply. I also tried to write a macro to do the colour change but I have just made a mess of it.

    Could someone please help. It is the very final part of a workbook due to go live by the end of the week.

    This is what my messed up code looks like -

    Sheets("Availability Report").Visible = True
    Sheets("Availability Report").Activate
    ActiveSheet.Unprotect "8440498"
    
    lastrow = FindLastRow
    
    Set rng1 = Range("E5:E" & lastrow)
    Set rng2 = Range("C5:C" & lastrow)
    
    With ActiveSheet
        For Each rcell In rng1.Cells
            If rcell.Value = "" Then
                rcell.Interior.ColorIndex = none
            ElseIf rng1.Value < rng2 Then
                rng1.Interior.ColorIndex = 22
           
            End If
         Next rcell
    End With
    
    Call SetProtection
    Last edited by Lovelylou79; 07-15-2013 at 05:59 PM. Reason: To Comply with Rule #3

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Conditional formatting on non-empty cells - VBA
    By kotonikak in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-18-2013, 02:57 PM
  2. Replies: 1
    Last Post: 09-02-2010, 12:39 AM
  3. Applying Conditional Formatting to an Entire Row
    By ltmaiyk in forum Excel General
    Replies: 4
    Last Post: 02-19-2010, 01:46 PM
  4. Applying Conditional Formatting to Data Validation
    By kcstewart in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-28-2007, 06:46 PM
  5. Applying conditional formatting to ODD rows
    By SirSFZ in forum Excel General
    Replies: 0
    Last Post: 03-31-2005, 10:46 AM

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