Hello,

I have used variations of the following code without error, but now for some reason it keeps displaying "Run Time Error 1004." Code is below.

Sub pivottable600166()
Dim sMonth As String
sMonth = "Mar"

Sheets.Add Before:=Sheets("Combined " & sMonth)
ActiveSheet.Name = "600166 " & sMonth

Dim PT600166 As PivotTable
Dim PTCache600166 As PivotCache
Sheets("Combined " & sMonth).Select
Set PTCache600166 = ActiveWorkbook.PivotCaches.Create(xlDatabase, Cells(1, 1).CurrentRegion)
Sheets("600166 " & sMonth).Select
Set PT600166 = ActiveSheet.PivotTables.Add(PivotCache:=PTCache600166, TableDestination:=Range("A3"))


With PT600166
    .PivotFields ("Cost Center")
    .Orientation = xlRowField
    .Position = 1
End With

With PT600166
    .PivotFields ("600166")
    .Orientation = xlColumnField
    .Position = 1
End With

End Sub
This is an abbreviated version of the table, but I think this portrays the general idea.

Thank you!