Hi

I'm using ActiveSheet.UsedRange.Rows.Count to identify the last row in a Pivot Table but when pivot table is updated and number of rows is less than the previous version it still counts the rows as if it's the old Pivot Table defining the area. Funny part is it only does it in the first sheet. All the following sheets is correctly updated. Any way to get around this?

Thanks,
Kjaer

Some details:

Old Pivot Table is 59 rows
New Pivot Table is 46 rows

I'm deleting the data not part of the Pivot Table using this code (PT has been updated at this point of time):

Range("I13:L65536").Select
Selection.Delete
Selection.Interior.ColorIndex = xlNone

Then I'm trying to identify the number of rows with this:

Dim myCount As Integer
myCount = ActiveSheet.UsedRange.Rows.Count

But when I copy the formulas I need and try to paste them next to the PT using this code:

Range("I12:L12").Select
Selection.Copy
Range("I13:L" & myCount).Select
ActiveSheet.Paste

it still assumes 59 rows