you seem to sort of know how to amend code but it seems you have trouble with syntax

here is some reading material for you

http://www.thespreadsheetguru.com/bl...l-pivot-tables
http://codevba.com/excel/PivotTable.htm
http://www.databison.com/how-to-read...ble-using-vba/