Hi,
I have this worksheet with 6000 rows and 650 columns. There are 10 columns which contain sumif (not sumifs) formulas with a single criteria for all rows from top to bottom. They pull data from a few columns from a second worksheet, which only has about 450 rows.
On the first worksheet I am applying fifteen simple conditional formatting rules. Except for two of the rules all rules only apply to a single column (highlighting certain cells), and the other two rules apply to all columns (highlighting certain rows in all columns). Most rules are very simple and have only one to two formula criteria, some have three to four criteria.
When, on the second worksheet, from which the sumif formulas on the first worksheet pull data, I insert or delete a row, it takes 3 - 6 seconds to do that. This is right after I open the workbook. If I work with the workbook for some time and then insert or delete a row on the second worksheet, it can take 10 - 20 seconds!
Now if I clear all the conditional formatting on the first worksheet I get quite a speed improvement, reducing the above durations from 100% to about 70%. The biggest impact has if I delete the sumif formulas on the worksheet, reducing the above durations further to probably 10-20%.
I tried to insert/delete rows via VBA, turning off calculations/screen updating/event before inserting/deleting and on again after, and setting a cell as an on/off switch for conditional formatting (adding a rule to stop all other rules if the cell says "off") and turning it off via vba before inserting, but it has no effect. My questions are:
1. Why does conditional formatting on the first sheet affect how quickly inserting/deleting happens on the second sheet, when the first sheet isn't even visible while inserting?
2. How can I remove conditional formatting completely via vba and restore it again after inserting/deleting rows (the rule trick with turning off/on again above apparently doesn't have an effect)?
3. Most importantly is there a faster alternative to sumif, preferably via formulas, or otherwise vba? If vba is the only way, what is the general speed gain?
Thanks!
Bookmarks