+ Reply to Thread
Results 1 to 6 of 6

Delete CF fill color, replace with regular fill color. Short code, can't figure it out!

  1. #1
    Registered User
    Join Date
    01-11-2016
    Location
    USA
    MS-Off Ver
    2010
    Posts
    19

    Delete CF fill color, replace with regular fill color. Short code, can't figure it out!

    Please Login or Register  to view this content.
    That's the snippet of my code I'm working on (excluded the rest). It obviously doesn't include a line to fill the cell with a red color, so that would need to be added. Basically, I can't figure out how to go through each cell in the range r12, check if the conditional formatting color is 49407, and if it is then delete the formatting out of the cell and fill it with red.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,625

    Re: Delete CF fill color, replace with regular fill color. Short code, can't figure it out

    Please Login or Register  to view this content.
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    01-11-2016
    Location
    USA
    MS-Off Ver
    2010
    Posts
    19

    Re: Delete CF fill color, replace with regular fill color. Short code, can't figure it out

    Quote Originally Posted by protonLeah View Post
    Please Login or Register  to view this content.
    Thanks, and how do I fill the color if "red" the statement is true but only for those cells? I've tried it before and it fills the entire range rather than the few cells where the CF applied (aka it was filled 49407).

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,625

    Re: Delete CF fill color, replace with regular fill color. Short code, can't figure it out

    You don't provide enough info to add or modify format conditions via VBA but you can color fill the cell with:
    Option Explicit
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    01-11-2016
    Location
    USA
    MS-Off Ver
    2010
    Posts
    19

    Re: Delete CF fill color, replace with regular fill color. Short code, can't figure it out

    Doesn't seem to work, unfortunately. It's doing what my attempts did - colors all the cells. Here's the full code including your piece.
    Please Login or Register  to view this content.
    To try, in column A enter in cells:
    A1 = Order Date
    A2 = 9/1/2016
    A3 = 10/1/2016
    A4 = 11/1/2016

    Ideally, when the code runs, it should conditional format just cell A3 (since it's the last month) in 49407 (and it does, if you edit out the test code), then in the test area for those conditionally formatted cells remove the coloring and just fill it with normal red.

    But like I said it does all cells

  6. #6
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,625

    Re: Delete CF fill color, replace with regular fill color. Short code, can't figure it out

    Maybe instead of deleting the old format, just modify it:
    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] How to fill color cells based on another cell's fill color?
    By putritersenyum in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-22-2016, 08:58 AM
  2. [SOLVED] Click oval option button to fill/unfill color, also change border color to match fill
    By Rocky2013 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-07-2015, 08:29 PM
  3. [SOLVED]Fill Color (highlight cells) but not to print fill color
    By itszille in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-24-2012, 05:37 PM
  4. Fill Cell with Color from Shape's color code
    By excelnewbie80 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-02-2012, 05:34 PM
  5. Delete any row WITHOUT a fill color
    By aorum in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-16-2011, 12:05 AM
  6. Delete any row WITH a red fill color (background)
    By aorum in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-13-2011, 07:52 PM
  7. Delete rows based on fill color
    By schueyisking in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-22-2008, 05:54 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