Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel code from 7 day data to 1 day data-pivot tables
Need to rewrite code for 1 day (24hours) instead of 7 days (24hours)
If (TheDay = "Day 1") Then ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:= _ "'Day 1'!A:M").CreatePivotTable TableDestination:="", TableName:= _ PTDay11, DefaultVersion:=xlPivotTableVersion10 If (TheDay = "Day 2") Then ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData _ :="'Day 2'!A:M").CreatePivotTable TableDestination:="", TableName _ :=PTDay11, DefaultVersion:=xlPivotTableVersion10 If (TheDay = "Day 3") Then ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData _ :="'Day 3'!A:M").CreatePivotTable TableDestination:="", TableName _ :=PTDay11, DefaultVersion:=xlPivotTableVersion10 If (TheDay = "Day 4") Then ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, _ SourceData:="'Day 4'!A:M").CreatePivotTable TableDestination:="", _ TableName:=PTDay11, DefaultVersion:=xlPivotTableVersion10 If (TheDay = "Day 5") Then ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData _ :="'Day 5'!A:M").CreatePivotTable TableDestination:="", TableName _ :=PTDay11, DefaultVersion:=xlPivotTableVersion10 If (TheDay = "Day 6") Then ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData _ :="'Day 6'!A:M").CreatePivotTable TableDestination:="", TableName _ :=PTDay11, DefaultVersion:=xlPivotTableVersion10 If (TheDay = "Day 7") Then ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData _ :="'Day 7'!A:M").CreatePivotTable TableDestination:="", TableName _ :=PTDay11, DefaultVersion:=xlPivotTableVersion10 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel should let me create pivot tables of non-numeric data. | Excel Discussion (Misc queries) | |||
Excel 2007 - Subtotals Below the Data in Pivot Tables | Excel Discussion (Misc queries) | |||
Grouping data with Pivot Tables Excel 2003 | Excel Discussion (Misc queries) | |||
Any way to programmatically make pivot tables behave more like data tables? | Excel Programming | |||
Retrieving Data from Excel Pivot tables into Datatable | Excel Programming |