1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| Dim tcd As String
tcd = "Tableau températures"
Range("A2").Select
ActiveCell.FormulaR1C1 = "Date"
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase, SourceData:= _
Selection).CreatePivotTable TableDestination:= _
"R3C6", TableName:=tcd, _
DefaultVersion:=xlPivotTableVersion10
ActiveSheet.PivotTables(tcd).AddFields RowFields:= _
"Date", ColumnFields:="Température"
With ActiveSheet.PivotTables(tcd).PivotFields( _
"Température")
.Orientation = xlDataField
.Caption = "Nombre de Température"
.Function = xlCount
End With |
Partager