Results 1 to 7 of 7

Conditional Formatting code not working

Threaded View

  1. #1
    Registered User
    Join Date
    06-24-2011
    Location
    ENGLAND
    MS-Off Ver
    Excel 2007
    Posts
    39

    Conditional Formatting code not working

    Hello All

    Ive put this coding together that sits the individual sheet code:

    Private Sub EOBTcondition()
    
    Dim Rng As range
    Dim texttime As range
    
    If Rng Is Nothing Then
    Else
    End If
    Exit Sub
    
    Set Rng = range("b2:b200")
    Set texttime = Sheet1("b9")
    For Each cell In Rng
    Select Case cell.Value
    Case Rng - textime <= 200
        cell.Interior.ColorIndex = 6
    End Select
    Next
    
    End Sub
    ...and it doesnt work.

    What it's supposed to do is take the value in cell b9 of Sheet 1 which is in a reference table, and ask whether or not the difference between its value and the value in any one of the cells in Rng is equal to or less than 200. If its within 200, the cells in Rng that are within 200, highlight yellow.

    Am I barking up entirely the wrong tree, or am I close?
    Any ideas?

    thanks!
    Adam
    Last edited by a8747; 11-25-2011 at 01:32 PM.

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