If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Update PivotTable Source

I have many differents Worksheets with 1 or more pivot tables, their source is always a worksheet.

For example, the source of a PivotTable is "sheet_data1!$A$1:$I$1149". The worksheet "sheet_data1" has 1149 rows. I have a program that changed this worksheet and it could increase or decrease the number of rows in that sheet.

So the pivot will not calculate certain rows if there are more rows tha before or consider empty rows when there are less rows than before.

I wish to update the source with right number of rows for each pivot table in the woorkbook. Is there a way to do this in this code?

Edit:
After the links given a changing a few things,it worked. Here is the code:

Advertiser Disclosure:
Some of the products that appear on this site are from companies from which QuinStreet receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. QuinStreet does not include all companies or all types of products available in the marketplace.