Hello, I have a macro that is failing to run. It has been running well daily for a few months, but today I received an error. The first step of the macro is to go to a separate tab and refresh a pivot table and then copy it.

The error is occurring at the copy step, just after refreshing. The copy is referencing the first item number at the top of the pivot (I highlighted it in red below), but today that item has changed, as our inventory changes daily. There is no guarantee that the first item number is always the same. Is there a way to generically reference the pivot, without an item number? Maybe with a cell reference?

This is the macro code:

Sheets("IRMS Available Pivot").Select
Range("A7").Select
ActiveSheet.PivotTables("PivotTable1").PivotCache.Refresh
ActiveSheet.PivotTables("PivotTable1").PivotSelect "'0052507'", xlDataAndLabel _
+ xlFirstRow, True