ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   pivotitems updating pivottable.... help!!! (https://www.excelbanter.com/excel-programming/411120-pivotitems-updating-pivottable-help.html)

[email protected]

pivotitems updating pivottable.... help!!!
 
I have a workbook containing some specific clients on sheet (1) and
a pivot Table on another sheet I need to update the Pivot Table with
only those Clients when I refresh the Pivot Table(“SpecClient”).
Example :-

Range Name (Sheet(1)!$K$3:$K$28 )

Client 104
Client 054
Client 730
Client 062

I would like to see in Pivot Table.pivot Items only clients 104,
054, 730, 062 and eventually another one should I add another client
in the existing Range. The Clients on the pivot table are on a page
field.


heres an example..

With ActiveSheet.PivotTables("SpecClient").PivotFields( "Name")
For CliName = 1 To Range Name
If cell is not empty then
.PivotItems(CliName).Visible = False
End If
Next CliName
End With

This works exactly the way i want but for one thing. The pivot table
is being updated as soon as change one of the pivotitems visible
property. This is annoying and slow. I will like to make all my
changes first then have the pivot table refreshed.

I added these 2 lines to my code...

Application.EnableEvents = False
Application.ScreenUpdating = False

but its still terribly slow....
to see what im talking about... create a pivot table... add a
pagefield.. record a new macro....select multiple items of the page
field... and stop the macro... now run the new macro... see how many
times the table is refreshed?...

can anyone help?


--
--------------------------------- --- -- -
Posted with NewsLeecher v3.9 Beta 8
Web @ http://www.newsleecher.com/?usenet
------------------- ----- ---- -- -



All times are GMT +1. The time now is 10:24 AM.

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