+ Reply to Thread
Results 1 to 4 of 4

How to make the command button override the conditional formatting

  1. #1
    Registered User
    Join Date
    01-01-2013
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    15

    How to make the command button override the conditional formatting

    Sales Follow up tasks.xlsm

    Here is a spreadsheet I am working on to track sales tasks.

    If you type a date in column J then all of the dates populate in column K:Y according to the data in row 3

    Once the dates are in the spreadsheet, you can type a date in cell I2 and any dates in columns K:Y that match will turn red. This is to indicate to me what tasks are due on certain days.

    I also have a command button set up so if I highlight a cell K:Y and hit the completed task command button then that cell will turn green signifying to me that the task for that date is complete.

    However, the conditional formatting that turns the cells red overrides the completed task (green cell)

    How can I make it so if I complete a task and turn it green then it will not change to red if I type in a due date.

    Hope this makes sense!

  2. #2
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Re: How to make the command button override the conditional formatting

    Please Login or Register  to view this content.
    Acts 4:12
    Salvation is found in no one else, for there is no other name under heaven given to mankind by which we must be saved.

  3. #3
    Registered User
    Join Date
    01-01-2013
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    15

    Re: How to make the command button override the conditional formatting

    Thank you Nate! That works!

    On thing is I have an undo button in case I mark a task as complete by mistake. Obviously at that point the conditional formatting is deleted...is there a way to write in the undo button code to have the conditional formatting come back?

    Here is the code for the button
    Please Login or Register  to view this content.
    This is the current conditional formatting:

    =AND(K5<>"", NOT(ISERROR(MATCH(K5,$I$2,0))))

    Thanks so much for your help!

  4. #4
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Re: How to make the command button override the conditional formatting

    That gets interesting. If you select a cell and look at your format conditions, the Applies To value is initially "=$K5:$Y$501". If you "complete" a cell, for example, K5, with the Selection.FormatConditions.Delete code included, the Applies To changes to "=$K$6:$Y$501,$L$5:$Y$5". If you then "complete" M7, it changes to "=$K$6:$Y$6,$L$5:$Y$5,$K$8:$Y$501,$K$7:$L$7,$N$7:$Y$7", and so on. It gets messy fast, and I don't know how you would reasonably adjust that to put the missing cell back in. My suggestion would be to do a Copy of a cell still containing the conditional formating, then PasteSpecial(xlpastevalues) back to the cell being undone. Assuming you could eventually have a lot of "completed" cells, the trick might be finding an uncompleted one to copy from.

+ 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. Make a Command Button Visible from another Command Button
    By trevor2524 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-13-2014, 10:11 AM
  2. [SOLVED] Submit button - how to add command 'remove' conditional formatting in code?
    By WillGe in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-18-2012, 08:34 PM
  3. Override conditional formatting issue
    By jpruffle in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-23-2011, 08:36 PM
  4. Override conditional formatting
    By greekboyuk in forum Excel General
    Replies: 12
    Last Post: 03-02-2011, 05:40 PM
  5. Prevent conditional formatting from being override
    By crapit in forum Excel General
    Replies: 1
    Last Post: 11-06-2005, 07:00 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