Sounds great.
How would this be incorporated into the following code
Public Sub ByDesc()
Application.ScreenUpdating = False
On Error Resume Next
Application.DisplayAlerts = False
Sheets("By Desc").Delete
Sheets("By Desc Chart").Delete
On Error GoTo 0
Application.DisplayAlerts = True
Worksheets("INPUT").Select
Range("A60").Select
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase, SourceData:= _
Range("A60").CurrentRegion.Address).CreatePivotTable TableDestination:="", TableName:= _
"PivotTable3"
ActiveSheet.PivotTableWizard TableDestination:=ActiveSheet.Cells(3, 1)
ActiveSheet.Cells(3, 1).Select
ActiveSheet.PivotTables("PivotTable3").SmallGrid = False
ActiveSheet.PivotTables("PivotTable3").AddFields RowFields:="NAME", _
ColumnFields:="M", PageFields:="DESC"
ActiveSheet.PivotTables("PivotTable3").PivotFields("AMOUNT").Orientation = _
xlDataField
ActiveSheet.PivotTables("PivotTable3").Format xlTable2
ActiveSheet.Name = "By Desc"
Sheets("By Desc").Move After:=Sheets(3)
Range("B5:M5").Select
Selection.ColumnWidth = 7
Range("A1").Select
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints(0.5)
.RightMargin = Application.InchesToPoints(0.5)
.Orientation = xlLandscape
.LeftFooter = "&B Confidential&B"
.CenterFooter = "&D"
.RightFooter = "Page &P"
End With
Range("A7").Select
Do
Range(ActiveCell, ActiveCell.Offset(0, 13)).Select
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
ActiveCell.Offset(3, 0).Select
Loop Until ActiveCell.Value = ""
Charts.Add
ActiveChart.SetSourceData Source:=Sheets("By Desc").Range("A1")
ActiveChart.Location Where:=xlLocationAsNewSheet
ActiveSheet.Name = "By Desc Chart"
Application.CommandBars("PivotTable").Visible = False
With ActiveChart.PageSetup
.LeftFooter = "&B Confidential&B"
.CenterFooter = "&D"
.RightFooter = "Page &P"
End With
End Sub