+ Reply to Thread
Results 1 to 2 of 2

Excel vba puzzle -- Thick or double cell borders significantly slow vba code

  1. #1
    Registered User
    Join Date
    10-01-2012
    Location
    New York
    MS-Off Ver
    Excel 2003
    Posts
    1

    Excel vba puzzle -- Thick or double cell borders significantly slow vba code

    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?

  2. #2
    Registered User
    Join Date
    11-25-2008
    Location
    Poland
    MS-Off Ver
    MSO 2K3, 2K10
    Posts
    84

    Re: Excel vba puzzle -- Thick or double cell borders significantly slow vba code

    This is a bug in Excel 2003. Be careful not to filter the data with bold borders.

    Artik

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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