• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Please help little urgent!!

Hi,

I have a workbook with pivot tables in it. I have moved some of my pivot tables to another workbook without the actual data and I have sent it to some other person.

The problem is the person whom I sent that file wants to delete some rows in the pivot table data and refresh it. Is there any way so that we can delete some rows in pivot cache and refresh it.

Thanks in advance

Regards
Dileep
 
Below code might help you if your pivots are linked to a master sheet.. and you might have to change the sheet name accordingly..

Sub RefreshPivotTableSource()
Application.ScreenUpdating = False

Dim lX As Long
Dim lY As Long

For lY = 1 To Worksheets.Count
For lX = 1 To Worksheets(lY).PivotTables.Count
Worksheets(lY).PivotTables(lX).ChangePivotCache ActiveWorkbook. _
PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Master Sheet!" & ActiveWorkbook.Worksheets("Sheet Name").Range("B2").CurrentRegion.Address(ReferenceStyle:=xlR1C1) _
, Version:=xlPivotTableVersion10)
Next
Next
Application.ScreenUpdating = True

End Sub
 
Back
Top