ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   pivotable excel2000 macro (https://www.excelbanter.com/excel-programming/315327-pivotable-excel2000-macro.html)

chaim rozent

pivotable excel2000 macro
 
i want to build a macro that chacks if pivotable(1)
is already refreshed.
if yes do....
if not do...



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Gary Brown[_8_]

pivotable excel2000 macro
 
Here's a macro for refreshing all pivot tables in a workbook. Hope this
helps.
Gary Brown

Sub PTRefresh()
'Refresh all pivot tables on this worksheet one at a time
'
Dim iSheets As Long, x As Long
Dim iPivot As Long, strCurrentSheet As String

On Error GoTo Exit_PTRefresh

'Count number of sheets in workbook
iSheets = ActiveWorkbook.Sheets.Count

'remember current sheet
strCurrentSheet = ActiveSheet.Name

If Windows.Count = 0 Then GoTo Exit_PTRefresh

For x = 1 To iSheets

'go to a worksheet to refresh pivot tables
Sheets(x).Activate

'turn warning messages off
Application.DisplayAlerts = False

'refresh all pivot tables on this worksheet one at a time
For iPivot = 1 To ActiveSheet.PivotTables.Count
ActiveSheet.PivotTables(iPivot).RefreshTable
Next

'turn warning messages on
Application.DisplayAlerts = True

Next

'return to worksheet that you were originally at
Application.ActiveWorkbook.Sheets(strCurrentSheet) .Activate

Exit_PTRefresh:
Application.DisplayAlerts = True

End Sub



"chaim rozent" wrote in message
...
i want to build a macro that chacks if pivotable(1)
is already refreshed.
if yes do....
if not do...



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!




Tom Ogilvy

pivotable excel2000 macro
 
This one Refreshes all external data ranges and PivotTables in the workbook.

Thisworkbook.RefreshAll

--
Regards,
Tom Ogilvy

"chaim rozent" wrote in message
...
i want to build a macro that chacks if pivotable(1)
is already refreshed.
if yes do....
if not do...



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!




chaim rozent

pivotable excel2000 macro
 

thank you for the quick answare
but i want only to chack, and not to refresh.
i have to make some operations before the refreshing
so the macro must identify if the pifotable was refreshed
or not
can you help me to build such macro?

thank you
rozent


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


All times are GMT +1. The time now is 09:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com