+ Reply to Thread
Results 1 to 1 of 1

Need error handler code to avoid pivot table refreshing error if no data is available

  1. #1
    Registered User
    Join Date
    06-02-2009
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    75

    Red face Need error handler code to avoid pivot table refreshing error if no data is available

    I have a pivot table that populates data in a tool that I am working on.. I have the following code updates that refreshes and update the pivot table when I add a record to he data

    Please Login or Register  to view this content.
    When I physically delete "all the records" from the source table, the above code generates an error since there is no records to deal with. I need to modify the code to account for this scenario and avoid code crash by either hiding the entire pivot table or show as blank instead of refreshing ..

    In case it helps, I have a variable called “nrec” that stores the number of data records. You may find something like the following helpful:

    Please Login or Register  to view this content.
    Last edited by adelkam; 03-04-2015 at 01:02 PM.

+ 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 in Code - Error Handler
    By joogibabu in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-09-2014, 07:24 AM
  2. Error Handler Help for Code that Copies a sheet to a new workbook
    By caliskier in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-27-2014, 12:47 PM
  3. [SOLVED] Error in code for pivot table chart
    By jaluht in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 02-17-2013, 04:59 PM
  4. Pivot Table VBA code: Out of Range Error
    By AmmonRA in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-17-2011, 07:58 AM
  5. [SOLVED] Form Err.Raise error not trapped by entry procedure error handler
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-08-2006, 06:25 AM

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