PROBLEME macro pour tableau dynamique

sokour

XLDnaute Occasionnel
Bonjour,

Je vous joint mon fichier avec la macro concernant un tableau dynamique.

A l'aide de l'enregistreur de macro, j'ai realise un tableau dynamique.

Puis je veux reutiliser cette macro mais il ne me rends pas le meme resultat, il ne prends pas en compte toutes lignes et les meme criteres : prenom et platform

MErci pour votre aide
 

Pièces jointes

  • exemple.xls
    41 KB · Affichages: 125
  • exemple.xls
    41 KB · Affichages: 136
  • exemple.xls
    41 KB · Affichages: 137

CB60

XLDnaute Barbatruc
Re : PROBLEME macro pour tableau dynamique

Bonjour
remplace ta macro par celle ci:
HTML:
  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
 

Discussions similaires

Membres actuellement en ligne

Aucun membre en ligne actuellement.

Statistiques des forums

Discussions
312 493
Messages
2 088 956
Membres
103 990
dernier inscrit
lamiadebz