+ Reply to Thread
Results 1 to 6 of 6

Code to add conditional formatting

  1. #1
    Valued Forum Contributor
    Join Date
    11-27-2013
    Location
    Waterbury, CT
    MS-Off Ver
    Office 365
    Posts
    1,175

    Code to add conditional formatting

    Hi.
    I have this macro below that creates 2 different conditional formats. The problem is that the second conditional format is not displaying the color the code instructed it to.
    Here is the workbook I am working with Conditional Formatting.xlsm

    And here is the code that sets two different conditional formats
    Please Login or Register  to view this content.
    Any help would be greatly appreciated.

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Code to add conditional formatting

    What color is it supposed to display?

    You reset the color to condition1 try:

    Please Login or Register  to view this content.
    Last edited by Solus Rankin; 03-27-2014 at 05:20 PM.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Valued Forum Contributor
    Join Date
    11-27-2013
    Location
    Waterbury, CT
    MS-Off Ver
    Office 365
    Posts
    1,175

    Re: Code to add conditional formatting

    Green.
    It really doesn't matter because i'm trying to test everything out. You can put whatever colour you want.
    The problem is that the color is being returned as blank. Also the CF shows that no format is set even though the code set it.

  4. #4
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Code to add conditional formatting

    I edited my first post. Try that.

  5. #5
    Valued Forum Contributor
    Join Date
    11-27-2013
    Location
    Waterbury, CT
    MS-Off Ver
    Office 365
    Posts
    1,175

    Re: Code to add conditional formatting

    Wow! It worked!
    I see what you did...you identified the 2nd condition as condition #2.
    I feel a bit sheepish
    Thank you

  6. #6
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Code to add conditional formatting

    You can actually do it with a single with block and without activate. Maybe:
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] VBA code for conditional formatting
    By Srikanth H N in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-03-2014, 11:51 AM
  2. Conditional Formatting Code - Deletes Wrong Conditional Format
    By RSpecianJr in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-29-2010, 10:53 AM
  3. Conditional Formatting with code
    By rlcohen70 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-14-2008, 04:51 AM
  4. Conditional formatting code please
    By Cath in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-21-2007, 06:34 PM
  5. vba code + conditional formatting
    By Sharp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-18-2007, 03:23 PM

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