LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Pivot tables and loop

Hi,

i'd like to put a pivot table macro in a loop.

what i get: 30 worksheet that contains data.

each worksheet (and its name) it's automatically generated by a loop
like this:

Sub mib30()

Dim symbol As String
Dim sdate As String
Dim sheet_name As String
Dim starget_range As String

sdate = Application.WorksheetFunction.Substitute(CStr(Date ), "-", "_")

For i = 1 To 30


symbol = Sheets("Summary").Cells(i, 1).Value
sheet_name = symbol + "_" + sdate
starget_range = sheet_name + "!" + "A1"

With Worksheets.Add
.Name = sheet_name
End With

Call get_data(symbol, starget_range)

Next i

End Sub

and generate names like: AL_17_10_2003, where 17_10_2003 is the
current date.

what i'd like to do is: automatically process this data with a Pivot
Table (one Pivot Table for each worksheet).

this the code of The pivot table for 1 worksheet:


ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:= _
"AUTO_13_10_03!R1C1:R15000C8").CreatePivotTabl e TableDestination:="",
TableName:= _
"PivotTable10"
ActiveSheet.PivotTableWizard TableDestination:=ActiveSheet.Cells(3, 1)
ActiveSheet.Cells(3, 1).Select
ActiveSheet.PivotTables("PivotTable10").SmallGrid = False
With ActiveSheet.PivotTables("PivotTable10").PivotField s("Volume
Ultimo")
.Orientation = xlDataField
.Position = 1
End With
With ActiveSheet.PivotTables("PivotTable10").PivotField s("Time Bin")
.Orientation = xlRowField
.Position = 1
End With

for me it's too tricky...

many thank's



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

 
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
need error loop in pivot table routine Jeff C Excel Discussion (Misc queries) 0 May 29th 08 11:08 AM
Building pivot tables in Excel 2007 based on existing pivot tables? [email protected] Excel Discussion (Misc queries) 4 December 26th 07 08:05 PM
For Each Loop with Pivot Table RestlessAde Excel Discussion (Misc queries) 2 August 8th 05 05:42 PM
How does the term 'pivot' apply to Excel's Pivot tables and Pivot. stvermont Excel Discussion (Misc queries) 1 February 17th 05 01:34 AM
Pivot tables-controlling user interaction with pivot tables Sindhura Excel Programming 0 August 27th 03 02:10 PM


All times are GMT +1. The time now is 02:09 PM.

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

About Us

"It's about Microsoft Excel"