Results 1 to 1 of 1

Excel 2007 conditional formatting bug

Threaded View

jmessina Excel 2007 conditional... 04-28-2008, 09:09 AM
  1. #1
    Registered User
    Join Date
    04-28-2008
    Posts
    1

    Excel 2007 conditional formatting bug

    I seem to have run across a bug in Excel 2007 regarding conditional formatting. If you insert a row in a table that has conditional formatting rules applied, and then copy another row that also has conditional formatting rules, Excel will add the new conditional formatting rules, rather than replacing them. So, if you started with 3 conditional formatting rules, then after the first iteration, you now have 6, then 9, then 12, etc. This quickly gets out of hand and performance degrades quickly.

    Here is the procedure for recreating the bug:
    1. Open a new Excel workbook in Office 2007
    2. Select cells A1:H1
    3. Apply formatting to the selected cells to put a border around the cells (only did this so that I could see the cells I was working with)
    4. Apply conditional formatting rules to the cells
    5. If cell value is < 0, turn text blue
    6. If cell value is between 0 and 1, turn text green
    7. If cell value is greater than 1, turn text red
    8. Hit CTL-C to copy the cells
    9. Select cells A5:A6 and hit CTL-V to paste the cells to rows 5 and 6
    10. Select row 6 (entire row selected)
    11. Insert a new row
    12. Select row 1 (entire row selected) and hit CTL-C to copy the row
    13. Select A6 (this is the row you just inserted) and hit CTL-V to paste the contents of row 1 into this row
    14. Select A6 (i.e. deselect the entire row)
    15. Review the conditional formatting rules for this cell. Note that the number of conditional formatting rules has been doubled. Additional conditional formatting rules will be added each time this procedure is repeated.

    I have an Excel application that uses a macro to automatically do this because I want a specific row template applied when the user inserts a new row. This template changes, based upon the type of data the user is intending to insert.

    Is there a way around this problem? Is there an option I can add to the paste command that will replace the conditional formatting rules, rather than adding additional rules?

    Thanks,
    John
    Last edited by VBA Noob; 09-18-2008 at 03:10 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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