fast running.zip
slow running.zip
I have searched the web with no luck regarding this problem and would appreciate someone's help in understanding what is going on. Attached are 2 excel spreadsheets, one labeled "fast running.xls" and the other labeled "slow running.xls". The only difference between the two is that "slow running" has a double border around cell N1. Running Excel 2003, if you click on the command button "Reset Filters/Show All" the time it takes to complete the vba macro is much slower with the spreadsheet containing the double border ("slow running") than without the border ("fast running"). On my PC (Windows 7, Dell Studio XPS 8000, Intel Core i7 CPU), in Excel 2003, the vba code in "slow running" takes about 6s whereas the vba code in "fast running" takes about 0.06s, a factor of 100 difference. Running the two spreadsheets in Excel 2010 the difference is very small, about 0.08s for "fast running" and 0.10s for "slow running". Since I am developing this code for users, some of whom run Excel 2003 while others run Excel 2010, I want the code to run fast with both versions. These two programs are only a small extracted portion of the full program I'm working on, in order to illustrate the problem.
Interestingly, if you add a double or thick border around cell N1 in "fast running", the code then runs slowly. However upon removing the borders the speed remains slow. Saving the file and re-opening does result in the code running faster. The problem appears to have something to do with the Autofilter function. Is this a know issue? Has anyone else experience it? Why is something so seemingly unrelated to the vba code causing a slowdown?
Bookmarks