Sub TAB1()
On Error Resume Next
Application.DisplayAlerts = False
Sheets("TCD").Delete
Set choix = Sheets("B").[a3].CurrentRegion
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase, SourceData:= _
choix).CreatePivotTable TableDestination:="", TableName:="Tcd"
ActiveSheet.PivotTableWizard TableDestination:=ActiveSheet.Cells(3, 1)
With ActiveSheet.PivotTables("tcd")
.PivotFields("prenom").Orientation = xlRowField
.PivotFields("prenom").Position = 1
.AddDataField ActiveSheet.PivotTables( _
"tcd").PivotFields("prenom"), "Count of prenom", xlCount
.PivotFields("Platform").Orientation = xlColumnField
.PivotFields("Platform").Position = 1
End With
ActiveSheet.Name = "TCD"
ActiveWorkbook.ShowPivotTableFieldList = False
Application.DisplayAlerts = True
End Sub