Google
 
Webnews.only-4-geeks.com
Interesting places
news.only-4-geeks.com Forum Index » Excel

Clear data from pivot table

 
Jump to:  
 
Klemen25
PostPosted: Wed Jun 18, 2008 12:25 pm    Post subject: Clear data from pivot table
       
Hello all.

Usually when building a pivot table report I throw the data sets in
the pivot table a few times to find the best way to show data.
So I wonder - is there a way to quickly erase all the data sets so the
pivot table is again empty as just being created (so I do not have to
select each data set and remove it?
Macro or some other trick?

The closest I got to the answer was the idea to just create another
pivot table from the original data…but it would be so much easier to
click a button and all the data is cleared from the pivot table.

Thank you as always people!
 

 
Debra Dalgleish
PostPosted: Wed Jun 18, 2008 12:25 pm    Post subject: Re: Clear data from pivot table
       
In Excel 2007 there's a Clear command on the PivotTable Options tab of
the Ribbon.
You could use a macro to clear the pivot table, in Excel 2003 or
earlier. This examples clears the pivot table for the active cell.
'====================
Sub ActiveCellClearPivot()

On Error Resume Next

Dim pt As PivotTable
Dim pf As PivotField

Set pt = ActiveCell.PivotTable
For Each pf In pt.VisibleFields
pf.Orientation = xlHidden
Next pf
'pt.RefreshTable

End Sub

'========================

Klemen25 wrote:
Quote:
Hello all.

Usually when building a pivot table report I throw the data sets in
the pivot table a few times to find the best way to show data.
So I wonder - is there a way to quickly erase all the data sets so the
pivot table is again empty as just being created (so I do not have to
select each data set and remove it?
Macro or some other trick?

The closest I got to the answer was the idea to just create another
pivot table from the original data…but it would be so much easier to
click a button and all the data is cleared from the pivot table.

Thank you as always people!


--
Debra Dalgleish
Contextures
LINK
Blog: LINK
 

 
Klemen25
PostPosted: Wed Jun 18, 2008 2:03 pm    Post subject: Re: Clear data from pivot table
       
Great!
Works like a charm.
I had in mind to mention that I use Excel 2003 but it slipped my mind.

Thank you!
 

Page 1 of 1 .:.

Google
 
Webnews.only-4-geeks.com

Windows Update | C++ | C | PHP | JavaScript | Photoshop | Programming | Windows 2000 | Python | Windows XP | Object | Flash | Flash - ActionScript | Paint Shop Pro | Excel | PowerPoint | Access | Word | Windows 98 | Internet Explorer 6.0 | CorelDraw12 | Java | XML | asm x86 | Linux Mandrake | Linux RedHat | Outlook |  | news from newsgroups |_ | s

Web Templates

Awesome Website Templates ©

teksty piosenek mieszkanie wrocław śmieszne teksty Zawory kulowe Kwiaty