+ Reply to Thread
Results 1 to 6 of 6

VBA help needed to capture Error and Remove Pivot if error exist else resume

  1. #1
    Registered User
    Join Date
    09-23-2014
    Location
    Chicago
    MS-Off Ver
    2010
    Posts
    31

    VBA help needed to capture Error and Remove Pivot if error exist else resume

    Hi I am no programmer. By reading threads and such I created a spreadsheet which has multiple macros. Basically a report generator.

    Excel version 2010

    Current Setup:
    On Load () I am forcing pivot tables to have certain filtering.

    Problem:
    When that filter is not available I am getting a VBA error. Or if I resume on Err. Filter is selected as whatever is available next (creates confusion on reporting)

    Proposed Resolution:

    I think I need to come up with a way where I check if error exist or not and move next. If exists I would like to remove the pivot table and move next, if no error than resume next.

    However, I have no clue how to achieve this. Would really appreciate guidance.

    Thank you!
    Last edited by Tescatlipoca; 11-18-2014 at 05:46 PM.

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,936

    Re: VBA help needed to capture Error and Remove Pivot if error exist else resume

    If you post your code, that would be helpful. But you could try code like this with multiple error handlers, where you could customize the response to errors.

    Please Login or Register  to view this content.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    09-23-2014
    Location
    Chicago
    MS-Off Ver
    2010
    Posts
    31

    Re: VBA help needed to capture Error and Remove Pivot if error exist else resume

    Quote Originally Posted by Bernie Deitrick View Post
    If you post your code, that would be helpful. But you could try code like this with multiple error handlers, where you could customize the response to errors.

    Please Login or Register  to view this content.
    Thank you Bernie, I am pasting the section of the code where I force the filters.

    Please Login or Register  to view this content.
    On your code above, how do I go to the next pivot table, as seen from my code I have 8 pivot tables.

  4. #4
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,936

    Re: VBA help needed to capture Error and Remove Pivot if error exist else resume

    This is how I would handle the first 3 (7 through 9)

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-23-2014
    Location
    Chicago
    MS-Off Ver
    2010
    Posts
    31

    Re: VBA help needed to capture Error and Remove Pivot if error exist else resume

    Thank you for your help!

  6. #6
    Registered User
    Join Date
    09-23-2014
    Location
    Chicago
    MS-Off Ver
    2010
    Posts
    31

    Re: VBA help needed to capture Error and Remove Pivot if error exist else resume

    Just an update tested, and works like a charm! thank you for your help!

+ 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. Error pops up on line On Error Resume Next
    By Erusso in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-20-2012, 04:57 PM
  2. Error 1004 impossible to capture with On Error go To
    By RagonichaFulva in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-20-2012, 12:10 PM
  3. [SOLVED] Resume on Error?
    By dan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-24-2006, 02:10 PM
  4. on error resume next
    By filo666 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-26-2006, 02:45 PM
  5. On Error Resume Next
    By Jasper in forum Excel General
    Replies: 0
    Last Post: 05-10-2005, 11:06 AM

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