Sub graphdyna()
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"PourTCD", Version:=xlPivotTableVersion12).CreatePivotTable TableDestination:=""
ActiveWorkbook.Names.Add Name:="choix", RefersTo:=Range("a1")
ActiveSheet.Shapes.AddChart.Select
ActiveChart.SetSourceData Source:=Range("choix")
ActiveWorkbook.ShowPivotChartActiveFields = True
ActiveChart.ChartType = xlColumnClustered
With ActiveSheet.PivotTables(1)
.PivotFields(1).Orientation = xlRowField
.PivotFields(1).Position = 1
.AddDataField .PivotFields(2), "Col B", xlSum
.AddDataField .PivotFields(3), "Col C", xlSum
.AddDataField .PivotFields(4), "Col D", xlSum
End With
ActiveSheet.PivotTables(1).Name = "TCD"
ActiveWorkbook.ShowPivotChartActiveFields = False
ActiveWorkbook.ShowPivotTableFieldList = False
End Sub