Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel should let me create pivot tables of non-numeric data. Geek4Life Excel Discussion (Misc queries) 4 April 25th 17 11:07 PM
Excel 2007 - Subtotals Below the Data in Pivot Tables TB in DC Excel Discussion (Misc queries) 2 November 3rd 08 02:19 AM
Grouping data with Pivot Tables Excel 2003 Leefisher Excel Discussion (Misc queries) 1 September 17th 07 07:44 PM
Any way to programmatically make pivot tables behave more like data tables? Ferris[_2_] Excel Programming 1 August 24th 07 06:20 PM
Retrieving Data from Excel Pivot tables into Datatable Chelvy Excel Programming 0 July 8th 06 12:10 AM


All times are GMT +1. The time now is 10:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"