Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Suspending PivotTable refresh in VB 1

Status
Not open for further replies.

GoatieEddie

Technical User
Nov 3, 2003
177
CA
Hi,

I have this code that works fine:

For Each PItem In ActiveSheet.PivotTables("PT-Table").PivotFields("Name").PivotItems
If Mid(PItem, 4, 1) = "A" Then PItem.Visible = True Else PItem.Visible = False
Next

However, each time it iterates it recalculates the pivottable. Can I turn this off at the beginning of the routine and back on at the end. I have tried Application.Calculation but this makes no difference.

Thanks,

GE
 
from VBA help:

ManualUpdate Property
See Also Applies To Example Specifics
True if the PivotTable report is recalculated only at the user's request. The default value is False. Read/write Boolean.

expression.ManualUpdate

expression Required. An expression that returns one of the objects in the Applies To list.

Remarks
This property is set to False immediately after your program terminates and after you execute the statement in the Immediate window of the Microsoft Visual Basic Editor.

Example
This example causes the PivotTable report to be recalculated only at the user's request.

Worksheets(1).PivotTables("Pivot1").ManualUpdate = True


Rgds, Geoff
[blue]Si hoc signum legere potes, operis boni in rebus Latinus alacribus et fructuosis potiri potes![/blue]
Want the [red]best[/red] answers to your questions ? faq222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top