Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / General Excel Questions / March 2008

Tip: Looking for answers? Try searching our database.

Last Refresh date for pivot table

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
HRobertson - 26 Mar 2008 16:33 GMT
Good morning.  I have a spreadsheet that contains a pivot table and am
wondering if there is a formula that can be used at the top of the
spreadsheet to provide the last date the pivot table was refreshed?  Any help
is much appreciated.

Thanks
Lori - 26 Mar 2008 18:44 GMT
Select a cell in the pivot table then Choose tools>macros>visual basic editor
[alt+f11] and type in the immediate window:
Activecell.PivotTable.RefreshDate
followed by enter.
Ron Coderre - 26 Mar 2008 19:30 GMT
Perhaps this User Defined Function (UDF):

Hold down the [ALT] key and press [F11]
...(to see the Visual Basic Editor)

Locate your workbook, in the left window list
Right-Click on it and select: Insert Module

Make sure the first line at
the top of that module is: Option Explicit

Then copy the below UDF code and paste it into that window
(anywhere under: Option Explicit)

Public Function LastPvtUpdate(rngCell As Range) As Variant
Dim cPvtCell As Range
Dim pvtTbl As PivotTable
On Error Resume Next
Set pvtTbl = rngCell.Cells(1, 1).PivotTable
If Err.Number = 0 Then
  With pvtTbl
     LastPvtUpdate = .RefreshDate
  End With
Else
  LastPvtUpdate = "Error: No Pivot Table Reference!"
End If
End Function

Now switch to the worksheet that has the Pivot Table.

Assuming your pivot table begins in cell B10...

This formula will return the last update date/time stamp
for the referenced pivot table data:
B9: =LastPvtUpdate(B10)

Format that cell as date/time
<format><cells><number tab>
Category: Time
Type: (select an appropriate date/time format)

OR....you could use something like this:
="Last refreshed: "&TEXT(LastPvtUpdate(B10),"m/d/yy h:mm AM/PM")

Is that something you can work with?
Post back if you have more questions.
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

> Good morning.  I have a spreadsheet that contains a pivot table and am
> wondering if there is a formula that can be used at the top of the
[quoted text clipped - 3 lines]
>
> Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.