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
Bookmarks