+ Reply to Thread
Results 1 to 2 of 2

Clear contend of Pivot table on close.

Hybrid View

  1. #1
    Registered User
    Join Date
    02-14-2014
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    33

    Clear contend of Pivot table on close.

    Hi All, your help would be much appreciated on the following. I am still a novice on VBA. I have created some code for excel 2007 which I have included below. The code on a click of a button opens a Pivot Table but it only brings back data for the user (Lan ID). What I would like to do is on close/exit clear all data in the pivot so when another user opens the Excel Spreadsheet it will not be populated with the last persons information.

    Thank you

    Private Sub CommandButton1_Click()
    With Sheets("DeliverykWhs").PivotTables("PivotTable4").PivotFields("LanID")
    
        .ClearAllFilters
        .CurrentPage = Environ$("Username")
        
        
        ActiveSheet.Rows("10:10").Hidden = True
        
    End With
    End Sub
    Last edited by ZuneidDassu; 02-24-2014 at 08:45 AM.

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Clear contend of Pivot table on close.

    Welcome to the forum.

    We'd like to help you but first..

    Pls take some minutes to read forum rules and specially-in this case- rule#3 and add code tags around your code.
    Then anyone will be able to help you.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

+ 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. Pivot table Cache clear
    By magnus101 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 10-25-2024, 02:06 AM
  2. Pivot table does not clear old Row Labels when refreshed?
    By crazysniper in forum Excel General
    Replies: 3
    Last Post: 01-17-2013, 11:30 AM
  3. Excel 2007 : How to Clear Pivot Table Filter?
    By dmweinst in forum Excel General
    Replies: 2
    Last Post: 10-01-2009, 01:31 PM
  4. How to clear the Pivot Table in VBA?
    By lazyme in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-04-2007, 04:39 PM
  5. Pivot table Clear Old Items
    By JonSparkes in forum Excel General
    Replies: 2
    Last Post: 03-05-2007, 07:08 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