+ Reply to Thread
Results 1 to 6 of 6

Retaining conditional format in a row

  1. #1
    Registered User
    Join Date
    01-04-2023
    Location
    Spokane
    MS-Off Ver
    10
    Posts
    4

    Question Retaining conditional format in a row

    Working on a project that highlights a date when it is near bolds it when its due and strikes it when its past.

    So far it seems to work just fine... except when you're adding an additional row or cut/paste the row. the conditional formatting includes a parameter formula within the column rather than staying within the row.

    I am hoping to figure out a way to lock down the conditional formatting, (or completing the task in a different way) so a user can cut/past and still have the rules apply.
    Attached Files Attached Files

  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
    27,162

    Re: Retaining conditional format in a row

    I'm not sure what you had in mind when you set these rules up. For example this rule:

    =$AA$9="strike"

    applies to D9:D10. Because of absolute addressing, both rows will refer to $AA$9. I don't think that's what you intend.

    Write one rule for the entire column D (I did this for you). Then you need one rule for each format. That should be immune to inserting or deleting rows, but if you paste anything into column D it will wipe out the conditional formatting for that cell unless you Paste Values. That will cause the Applies To range to be broken up. That just how it works--when you do a Paste, it pastes everything.

    You could do something a bit more complicated with VBA, which would be absolutely immune to any shenanigans on the sheet.
    Attached Files Attached Files
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    01-04-2023
    Location
    Spokane
    MS-Off Ver
    10
    Posts
    4

    Re: Retaining conditional format in a row

    Jeff, My apologies, I had thought my reply had been submitted, but it looks like i had some difficulties on my end.

    I looked over your modifications, and it seems like it works although I am a little confused how it works? for example, Cell D13 Conditional Formatting (red no strike) refers to cells AG1<AE1, which is the header? yet somehow this code is functional. however D14 has the same formatting, yet does not work

    My thoughts were to create a sort of flag system that would tell me when am getting close to a date with these formulas. I am trying to have a 6 day heads up notice for these guys.

    Thanks for the Help!

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

    Re: Retaining conditional format in a row

    Conditional formatting rules are written as though they apply to the upper-left cell in the Applies To range. In this case that range is D:D so the rules are written as if they were for D1. Therefore references to other cells in the same row also look like row 1. But they are applied to the actual row with the data to be formatted. So for formatting D14, the rule is applied to AG14 and AE14. The idea is similar to relative references in worksheet formulas.

    It looks to me like D14 works the same as the other rows.

  5. #5
    Registered User
    Join Date
    01-04-2023
    Location
    Spokane
    MS-Off Ver
    10
    Posts
    4

    Re: Retaining conditional format in a row

    Wow, i see now, this is really awesome, i think this solves my problems Thank you!

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

    Re: Retaining conditional format in a row

    Glad to help!

    If your question has been answered please mark your thread as "Solved" so that members will know by looking at the thread title that your problem is solved. Go to the menu immediately above your first post to the thread and click on Thread Tools. From the dropdown menu select "Mark this thread as solved..."

    If a member helped you solve your problem, consider adding to their reputation by clicking addreputationiconsmall.jpg below their name.

+ 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] Concatenate with dates not retaining the format
    By kyber in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-14-2021, 01:30 PM
  2. [SOLVED] Retaining format on pasting
    By Frankie_The_Flyer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-10-2019, 07:48 AM
  3. Replies: 3
    Last Post: 04-18-2011, 01:51 PM
  4. Retaining number format
    By PooH in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-08-2010, 10:03 AM
  5. Retaining Fraction Format
    By Greg Shah in forum Excel General
    Replies: 4
    Last Post: 03-18-2008, 09:14 AM
  6. Retaining Arrow Format
    By surfengine in forum Excel General
    Replies: 2
    Last Post: 08-15-2007, 07:19 PM
  7. [SOLVED] Retaining Excel graph format
    By Lance Wallace in forum Excel General
    Replies: 0
    Last Post: 06-04-2006, 12:15 PM

Tags for this Thread

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