I tried this piece of code to get the results but not working the way I need it to. Not very familiar with VBA code for Pivot Tables so any assistance is appreciated. Thanks
Sub Create_PivotTable()
Dim PT As PivotTable
Dim PTCache As PivotCache
Worksheets("SAMPLE").Select
Columns("M:W").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Columns("M:W").ClearContents
Set PTCache = ActiveWorkbook.PivotCaches.Create(xlDatabase, Cells(1, 1).CurrentRegion)
Set PT = ActiveSheet.PivotTables.Add(PivotCache:=PTCache, TableDestination:=Range("M1"))
With PT
.PivotFields("Date").Orientation = xlRowField
.PivotFields("Cust ID").Orientation = xlRowField
.PivotFields("Client Name").Orientation = xlRowField
.PivotFields("Amount").Orientation = xlColumnField
End With
End Sub
Bookmarks