I created a macro that I want it to work on the active worksheet, not just on the particular worksheet I created the macro on. Here is how it starts. I assume there is an issue with the "pivotTable4" Thanks for your help.

ActiveSheet.PivotTables("PivotTable4").PivotFields("CUSTOMER NAME").AutoSort _
xlDescending, "SALES DOLLARS", ActiveSheet.PivotTables("PivotTable4"). _
PivotColumnAxis.PivotLines(4), 1