How do you end up remembering the code for making a pivot table?
I use the macro recorder and then generalize the recorded code, or
I use a wrapper function that I created for me that suits the way I prefer to work
'creates PT from .CurrentRegion around 'PivotRange' and put it on a new 'PivotSheet A1' and names it 'PivotName'
' pass single value or array of PivotDataFields
' and/or PivotRowFields and/or PivotRowFields and/or PivotPageFields
'create PT (Input range, output sheet name, PivotName,
' array(data), array (rows), array (cols), array (pages),
' quick format = all data = sum, grandtotals and subtotals, shading on total lines
'
'data, row, column, page items can be "LIST_NAME=NEW_NAME;NUMBERFORMAT"
Function PT_Create(PivotRange As Range, PivotSheet As String, PivotName As String, PivotDataFields As Variant, _
Optional PivotRowFields As Variant, Optional PivotColFields As Variant, Optional PivotPageFields As Variant, _
Optional PivotQuickFormat As Boolean = True) As PivotTable