+ Reply to Thread
Results 1 to 9 of 9

Excel 2007 Advanced Filter slowness after 1 record added

  1. #1
    Registered User
    Join Date
    05-26-2014
    Posts
    49

    Excel 2007 Advanced Filter slowness after 1 record added

    I have an Advanced Filter I call repeatedly using different search criteria , where a database is searched, and the resulting records are extracted to another sheet in the same Workbook. Works fine, and is usually lightning fast. On the order of .1 second for 12 searches.

    Seem as soon as I add a record to the existing sheet , the Advanced Filter becomes extremely slow and pins the cpu at full usage. The filter still works, but takes 100 times as long!

    Something is not right, and I can't figure it out.

    This is the basic code that does all the work

    Please Login or Register  to view this content.
    I have
    Please Login or Register  to view this content.
    As you can see , the search range is very large but there are only 20,000 populated rows, so adding 1 row to that should not be causing such a slowdown.

    Reducing the 999,999 to something smaller speeds up the filter , but its still very slow. It's as if Excel does an optimized search until the range is touched, then forgets how for the remainder of the session. Reloading the sheet fixes it until the next added record.

    Any ideas on how to fix this?

    Excel 2007
    Windows 7 X64, 8 gig ram
    Last edited by alansidman; 05-26-2014 at 11:51 PM. Reason: code tags added

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: Excel 2007 Advanced Filter slowness after 1 record added

    Code Tags Added
    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between
    Please Login or Register  to view this content.
    tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    (Because you are new to the forum, I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    Why are you using such a large range if there are only 20000 rows?

    Have you tried limiting the range to filter to the actual data?
    If posting code please use code tags, see here.

  4. #4
    Registered User
    Join Date
    05-26-2014
    Posts
    49

    Re: Excel 2007 Advanced Filter slowness after 1 record added

    Yes, I could and should make the range dynamic based on the last used cell.
    This is a very old project, and doing it the current way has not been a problem until fairly recently.

    I don't think it would address the slowdown problem in any case based on my recent testing. It would be less of an issue with a smaller range, granted. But over time , it would still be a big problem as the data grows.

    What possible excuse is there for Excel to take near ZERO time one pass, and then 5-8 seconds on the next to do the exact same operation?
    Last edited by jdop; 05-27-2014 at 12:57 PM.

  5. #5
    Registered User
    Join Date
    05-26-2014
    Posts
    49

    Re: Excel 2007 Advanced Filter slowness after 1 record added

    Tried reducing the range and as expected it does not help at at all.

    Can reliably get this to break, just add a single row to the data, not inserting, just new data copied into the next row.

    Time Before, and after, in seconds. Pretty sad.

    time= 0.1796875
    time= 35.69141


    Is this some unheard of problem?

    fwiw, just copied that data to another sheet in the workbook. There are other things going on in the original sheet, though they should not have any impact on this issue.

    After a few tests I dont see the problem when using the new sheet as source.

    This is a project I've been working on for a decade, and have solved many issues with excel weirdness.
    Last edited by jdop; 05-27-2014 at 04:32 PM.

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    Could you post your code?

    Also, what 'other' things are happening in the worksheet?

  7. #7
    Registered User
    Join Date
    05-26-2014
    Posts
    49

    Re: Excel 2007 Advanced Filter slowness after 1 record added

    Well, other than the single criteria, a persons name, there's nothing in code other than what I already posted.

    That's whats so strange, very little room for Excel to get confused.

    There are some vlookups on the sheet that access the same range, but as I've said, nothing is negatively affected until some trivial text is added to the sheet, which makes no sense at all.

    I'll have to assume theres something odd in the sheet structure that cant be divined and work around it.

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Excel 2007 Advanced Filter slowness after 1 record added

    No other code?

  9. #9
    Registered User
    Join Date
    05-26-2014
    Posts
    49

    Re: Excel 2007 Advanced Filter slowness after 1 record added

    lol, the hangup is right at that piece of code I posted. There are many lines of code, none relevant to this.

    AdvancedFilter is where the slowdown is. It runs, but at 1/100th normal speed.

    So far , moving that data to its own sheet, seems to have solved the problem in limited testing.

    I say, its some nasty memory management issue internal to Excel.

    The problem may not even show up in later versions.

+ 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. Advanced filter help using Excel 2007
    By thefreelove in forum Excel General
    Replies: 4
    Last Post: 08-22-2013, 09:04 PM
  2. Excel 2007 : Advanced filter issue
    By Nikeyg in forum Excel General
    Replies: 2
    Last Post: 04-06-2013, 05:53 AM
  3. Excel Slowness in 2007 vs 2003
    By bsmith81 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-05-2008, 11:46 AM
  4. Excel 2003 v 2007 slowness
    By bsmith81 in forum Excel General
    Replies: 1
    Last Post: 02-05-2008, 11:38 AM
  5. [SOLVED] Excel 2007 Beta Advanced Filter Performance
    By RHoodnkt in forum Excel General
    Replies: 1
    Last Post: 08-12-2006, 06:00 PM

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