+ Reply to Thread
Results 1 to 5 of 5

Pivot Tables Using VBA

  1. #1
    Registered User
    Join Date
    10-03-2014
    Location
    Montreal
    MS-Off Ver
    2010
    Posts
    16

    Pivot Tables Using VBA

    Hey guys!

    I need help with regards to applying filters to a pivot table with VBA.

    My code works fine when the applied filters are available in the pivot table. However, my code stops whenever an applied filter is not found.
    For that reason, I was thinking of using a loop that would continue to next filter on error... but I don't know how to code it or even if that would work.

    Here is my code below that applies my filters to the pivot table:

    HTML Code: 

    The code stops working when either today's date or tomorrow's date is not available as a filter.

    Help please

  2. #2
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Pivot Tables Using VBA

    untested - maybe try putting in something like this

    Please Login or Register  to view this content.
    Ernest

    Please consider adding a * if I helped

    Nothing drives me crazy - I'm always close enough to walk....

  3. #3
    Registered User
    Join Date
    10-03-2014
    Location
    Montreal
    MS-Off Ver
    2010
    Posts
    16

    Re: Pivot Tables Using VBA

    Quote Originally Posted by judgeh59 View Post
    untested - maybe try putting in something like this

    Please Login or Register  to view this content.
    *Yes this helped thank you

  4. #4
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Pivot Tables Using VBA

    Glad this helped....major note though....turning on "On Error" can mask real errors, so use it carefully...

  5. #5
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Pivot Tables Using VBA

    If this has been completed to your satisfaction, please set the thread to Solved...If you feel I deserve an increase in my reputation, feel free to click on the star in the lower left of the thread. Remember, someday when you help somebody they may add to your rep points, and it could be me...just a thought...

+ 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. Creating a Master / Consolidated Pivot Tables from a multiple pivot tables
    By paradise2sr in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 12-12-2013, 02:28 AM
  2. Creating a Master / Consolidated Pivot Tables from a multiple pivot tables
    By paradise2sr in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 12-08-2013, 10:49 PM
  3. Pivot Tables - need to do separate pivot tables for multiple sheets in same format
    By tconnell1965 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-18-2013, 07:04 AM
  4. Replies: 3
    Last Post: 08-21-2013, 05:12 PM
  5. Replies: 0
    Last Post: 09-22-2012, 07:22 PM

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