+ Reply to Thread
Results 1 to 4 of 4

Filtering Pivot - VBA taking too long

  1. #1
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    Filtering Pivot - VBA taking too long

    Hi i have the following code that is filtering over 40k lines of data but is taking too long, is there anyway to speed this up?

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    Re: Filtering Pivot - VBA taking too long

    'Bump - No response

  3. #3
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Filtering Pivot - VBA taking too long

    Hi,

    in fact, filtering pivot tables is horrible..

    Changes:
    1. Declare your variables !
    2. Looping the worksheets only once
    3. At first removing all filters from the pivot table, then hiding according to conditions. This is faster than setting an item to visible which is visible already.
    4. "If" condition rewritten, the problem with "If xx Or yy" is that although xx is true, yy is checked too. Therefor place the condition which will be most likely true at the beginning.

    Cannot test it with 40k records (slow machine) but experienced half runtime with 1k records.

    Code:
    Please Login or Register  to view this content.
    Please use [CODE]-TAGS
    When your problem is solved mark the thread SOLVED
    If an answer has helped you please click to give reputation
    Read the FORUM RULES

  4. #4
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    Re: Filtering Pivot - VBA taking too long

    Ah i see where i went wrong, you are a genius!

    Thank you so much

+ 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. taking too long to load2
    By muhdass in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-19-2013, 05:22 AM
  2. taking too long to load
    By muhdass in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-18-2013, 11:54 PM
  3. Macro taking too long to execute
    By jacob@thepenpoint in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-23-2012, 05:13 PM
  4. Is there anyway to see why ScreenUpdating is taking so long?
    By foxguy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-11-2011, 04:17 AM
  5. Manual Calc taking way too long
    By wbd_kelley@yaho in forum Excel General
    Replies: 2
    Last Post: 05-13-2008, 02:06 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