Private Sub Worksheet_Activate()
'Macro par Dan pour deni29 - le 28/02/06
'Post XLD : [B]Lien supprimé[/B]
Dim plage As Range
Set plage = Sheets('Suivi Journalier').Range('A1').CurrentRegion
Sheets('statistiques').Cells.Clear
With Sheets('Suivi Journalier')
.PivotTableWizard SourceType:=xlDatabase, SourceData:= _
plage, TableDestination:=Sheets('Statistiques').Range('A1'), TableName:='TCD'
End With
With ActiveSheet.PivotTables('TCD')
.SmallGrid = False
.AddFields RowFields:='Date', PageFields:='Moyen en panne'
With ActiveSheet.PivotTables('TCD').PivotFields('Date')
.Orientation = xlDataField
.Name = 'Total par mois/an'
.Function = xlCount
End With
.PivotSelect 'Date', xlButton
Selection.Group Start:=True, End:=True, periods:=Array(False, False, False, _
False, True, False, True)
End With
End Sub