When you are asking us how to do something, it is a good idea to give us exact details if you are not able to adapt it yourself. Your pivottable and pivot field are named differently to what you showed.
Assuming the pivot table is the only one on the sheet, this works
Dim pi As PivotItem With ActiveSheet.PivotTables(1).PivotFields("Account Number") For Each pi In .PivotItems .CurrentPage = pi.Name Next End With