+ Reply to Thread
Results 1 to 5 of 5

Keep Conditional Formatting When Using Find and Replace

  1. #1
    Registered User
    Join Date
    05-06-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    9

    Keep Conditional Formatting When Using Find and Replace

    I have a work schedule that needs formatting. Ideally I would like to create and run a macro to make the necessary format changes. I've used conditional formatting to change the shading of the cell (whether the shift was a regular shift, overtime shift, vacation shift, sick shift, etc.) The cell also contains text that indicates whether the shift was a Day shift or Night Shift. I tried using Find and Replace to change the Day shift code to "D" and the night shift code to "N" but when I do this I loose all the conditional formatting and the color codes. Any suggestions on how to work around this?

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,781

    Re: Keep Conditional Formatting When Using Find and Replace

    Doing a Find & Replace does not affect conditional formatting rules. But if you have a rule that fills a cell with blue color when the shift is DAY, and you change the cell to D, yes, the cell will no longer be blue. Is that what you mean? It would help if you would attach your file.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    05-06-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Keep Conditional Formatting When Using Find and Replace

    Yes, that is what I mean, and I now understand that I am changing the conditional formatting I originally set and that is why I am loosing the color. Is there another way to do what I am trying to do? Attached is the spreadsheet with the cells shaded different colors and I would like to then be able to change them to "D" or "N" and delete all the other text but still keep the shaded cells.
    Attached Files Attached Files

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Keep Conditional Formatting When Using Find and Replace

    Im not really sure what you are trying to change there, but I would suggest that you change your CF "applies to" range from full columns to a specific range. CF starts to become a resource-hog when applied to full columns
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,781

    Re: Keep Conditional Formatting When Using Find and Replace

    I'm getting the impression that you mean you want the cells to stay the same color they are now. There will be only two new values, D and N, but you have 8 different colors. There is no conditional formatting rule that says, "Determine cell color based on what the content used to be."

    If you want to preserve the colors, you will have to update the colors manually before changing the values in those cells. The most straightforward way to do this is to do a Find All for a value (such as Vacation), then use the results of the Find All to select all of the matching cells, then set the fill color from the Fill tool. That has to be repeated for each different value in your conditional formatting rules. It should take less than 5 minutes. Then you would do your find & replace.

    The only other solution I can think of requires a moderate effort to write some VBA to do it. It would take a lot more than 5 minutes.

+ 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. Conditional find and replace?
    By jzsscoop in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-04-2011, 12:27 PM
  2. Find & Replace Stripping Formatting
    By Jbm444 in forum Excel General
    Replies: 3
    Last Post: 08-05-2010, 03:58 AM
  3. conditional find and replace
    By Digger442 in forum Excel General
    Replies: 1
    Last Post: 03-14-2007, 11:13 PM
  4. Conditional FIND and REPLACE
    By wisynco in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 06-07-2006, 01:46 PM
  5. Find/Replace w/ Conditional Formatting?
    By bludovico in forum Excel General
    Replies: 1
    Last Post: 04-29-2005, 10:13 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