+ Reply to Thread
Results 1 to 7 of 7

Conditional Formatting code not working

  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:

    Please Login or Register  to view this content.
    ...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.

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Conditional Formatting code not working

    Close...
    Please Login or Register  to view this content.

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

    Re: Conditional Formatting code not working

    Hi Stephen
    I get a
    "compile error:
    Statements and labels invalid between Select Case and first case"

  4. #4
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Conditional Formatting code not working

    Not sure what you've done, but sorry, it should be:
    Please Login or Register  to view this content.
    But how do you get past this line without an error!?
    Please Login or Register  to view this content.

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

    Re: Conditional Formatting code not working

    Quote Originally Posted by StephenR View Post
    But how do you get past this line without an error!?
    Please Login or Register  to view this content.
    Ha, who knows!? There's something wrong with it?

    So far then, Ive got this:

    Please Login or Register  to view this content.
    I still get the same error and I'm wondering, perhaps this code should be based on worksheet_change becuase I need it to update automatically....the value in 'texttime' is updating every few minutes when excel recalculates.

  6. #6
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Conditional Formatting code not working

    That's not what I posted. Btw how come your code didn't just exit at the top?
    Please Login or Register  to view this content.
    Btw you could have used proper conditional formatting for this.

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

    Re: Conditional Formatting code not working

    Thats got me further along, but I now have just the entire Rng highlighted in yellow?

    I tried the standard conditional formatting outside of VBA, but it wouldnt let me set a conditional format using a range in another sheet; unless you're referrring to something else?

    thanks

+ 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