+ Reply to Thread
Results 1 to 16 of 16

Conditional Formatting Issues when adding new rows

  1. #1
    Registered User
    Join Date
    04-06-2016
    Location
    London, England
    MS-Off Ver
    Excel 2013
    Posts
    18

    Conditional Formatting Issues when adding new rows

    Hello, I have written quite a few rules for a large database of information that changes the colour of the row depending on various conditions. This is all working perfectly right now, BUT... when a new row is inserted, I need all of the conditional formatting (and formulae in certain columns) to apply to the new row too. At the moment, when I insert a new row, it changes the colour of SOME of the existing rows. So, when I insert a new row underneath row 17, the colour of row 21 changes from purple to red when it should stay as it was. Is this an issue with my conditional formatting or with the formulae in the cells?

    And example of a conditional format is as follows:

    Rule: =AND($AH14>0,$AG14>0,$AI14<>0)
    Format: Changes row to red
    Applies to: =A14:AI3000


    Please can anyone spot my error? The document is huge and contains 12 worksheets which all interact with each other. This is why I haven't uploaded it yet. I can't really split it but could upload the whole thing if the information above isn't enough.

    Thank you in advance...
    Last edited by curdley; 04-22-2016 at 07:30 AM. Reason: attachment

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Conditional Formatting Issues when adding new rows

    What is the CF to change a row to purple?
    The best way for us to diagnose something like this is with an example worksheet. Can you upload a workbook without confidential info in it? (Go Advanced>Manage Attachments). Even if it's just that one sheet with the CF in it.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    04-06-2016
    Location
    London, England
    MS-Off Ver
    Excel 2013
    Posts
    18

    Re: Conditional Formatting Issues when adding new rows

    Thank you....I've attached a very stripped back version!

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Conditional Formatting Issues when adding new rows

    Everything is purple in your example because of the number of errors that are showing up (#REF).
    The defined name VOL is giving #REF so that screws up many of your VLOOKUPS.
    Is that because you stripped this down?

    Looking at your conditional formatting, it looks reasonable although not consistent. I would start there and fix the ranges so they are consistent, i.e = $A$14:$AI$10455.
    You have two red rules, delete one
    The rules themselves are unique and one shouldn't interfere with another.
    Since I can't duplicate your error (everything is purple), that's about all I can tell you.

  5. #5
    Registered User
    Join Date
    04-06-2016
    Location
    London, England
    MS-Off Ver
    Excel 2013
    Posts
    18

    Re: Conditional Formatting Issues when adding new rows

    Thanks for your help. The file size limit precluded me from including enough worksheets to populate the sheet. I will do what you've suggested and tidy up the CF and then let you know how I got on.
    Many thanks...

  6. #6
    Registered User
    Join Date
    04-06-2016
    Location
    London, England
    MS-Off Ver
    Excel 2013
    Posts
    18

    Re: Conditional Formatting Issues when adding new rows

    It's still not working, unfortunately. I wonder if the issue lies with the formulae elsewhere. It's so frustrating...I can't make the file smaller without losing all of the bits that feed the formulae. Is it possible that the error lies with the formulae in the cells rather than the conditional formatting that changes the row colour?

  7. #7
    Registered User
    Join Date
    04-06-2016
    Location
    London, England
    MS-Off Ver
    Excel 2013
    Posts
    18

    Re: Conditional Formatting Issues when adding new rows

    I've attached another spreadsheet that just shows screenshots of an example CF and the range. Does this help at all? I just don't understand why the formatting goes wrong when I insert a row.
    Attached Files Attached Files

  8. #8
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Conditional Formatting Issues when adding new rows

    Do you use any INDIRECT functions in the spreadsheet? Maybe you can convert some of the formulas to constants (Paste values) before you delete whatever they are referencing. For example Columns N, S and T and then upload it again.

    You could also Zip the file and upload it if that makes it manageable.

  9. #9
    Registered User
    Join Date
    04-06-2016
    Location
    London, England
    MS-Off Ver
    Excel 2013
    Posts
    18

    Re: Conditional Formatting Issues when adding new rows

    Does this help?
    Attached Files Attached Files

  10. #10
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Conditional Formatting Issues when adding new rows

    The formula in AH is the problem.

    =INDEX('Mar 2016'!$A$13:$W$1289,,17) will return the value on the same row from Col Q of Mar 2016. So row 20 is 0, then you insert a row, and row 21 is 129.99 (130). So it is not doing what you want it to do. What do you want Column AH to be doing?

  11. #11
    Registered User
    Join Date
    04-06-2016
    Location
    London, England
    MS-Off Ver
    Excel 2013
    Posts
    18

    Re: Conditional Formatting Issues when adding new rows

    You're right!
    Column AH should be finding the machine number (in column J) in the worksheet titled 'Mar2016' and then returning the value from column N. The idea is that it shows me what the previous quarterly invoice value was on the current quarterly spreadsheet.
    Does that make sense? I couldn't do VLOOKUP as I can't put machine number in column A.

  12. #12
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Conditional Formatting Issues when adding new rows

    VLOOKUPS don't need to always begin with Col A. Looks like the machine number is in Col J of Mar 2016 also so we'll have the range be 'Mar 2016'!$J$14:$N$1171

    So in AH14 of Jun 2016, copied down

    =VLOOKUP(J14, 'Mar 2016'!$J$14:$N$1171, 5, FALSE)
    That should stabilize your workbook a bit.

  13. #13
    Registered User
    Join Date
    04-06-2016
    Location
    London, England
    MS-Off Ver
    Excel 2013
    Posts
    18

    Re: Conditional Formatting Issues when adding new rows

    I'm offline now but will try this tomorrow. I'm so grateful. I always keep these threads so that I know what to do next time. Thank you

  14. #14
    Registered User
    Join Date
    04-06-2016
    Location
    London, England
    MS-Off Ver
    Excel 2013
    Posts
    18

    Re: Conditional Formatting Issues when adding new rows

    Good morning It's actually the value from column Q (invoice total) that needs to be pulled back in to column AH. So, I changed the '5' in your formula to '8' but this gave me a #REF value? Have I changed the wrong bit of the formula?

  15. #15
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,887

    Re: Conditional Formatting Issues when adding new rows

    You need to change the range to include column Q

    =VLOOKUP(J14, 'Mar 2016'!$J$14:$Q$1171, 8, FALSE)

  16. #16
    Registered User
    Join Date
    04-06-2016
    Location
    London, England
    MS-Off Ver
    Excel 2013
    Posts
    18

    Re: Conditional Formatting Issues when adding new rows

    It works!
    It works....it works....it works...!!!
    Thank you SOOOOOOO much

+ 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 Formatting Issues
    By mlbdc2012 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 04-05-2016, 05:55 PM
  2. Replies: 7
    Last Post: 06-20-2015, 02:12 PM
  3. Inserting/Deleting Rows Causes Issues with Conditional Formatting Macro
    By lashellr in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-05-2014, 01:25 PM
  4. Conditional Formatting when adding rows
    By airfrc1 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-29-2014, 08:42 AM
  5. Replies: 8
    Last Post: 11-26-2013, 07:37 PM
  6. lose range conditional formatting adding/deleting rows
    By mrodenkirch in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-29-2013, 12:46 PM
  7. Issues with formula when adding/subtracting rows
    By hektisk in forum Excel General
    Replies: 1
    Last Post: 07-21-2011, 11:16 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