Thread: Pivot Tables
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bob_Questions[_2_] Bob_Questions[_2_] is offline
external usenet poster
 
Posts: 1
Default Pivot Tables

Hi,

I have recorded the macro below that creates a Pivot Table. What I would
like to do is add additional sheets to the Array below by using a macro. It
would be great if I could type in an additional sheet names by using an Input
Box. Since this is for payroll, I will probably have over 52 sheets by the
end of the year.

Range("A13").Select
ActiveSheet.PivotTableWizard SourceType:=xlConsolidation,
SourceData:=Array _
("'01062005'!R11C2:R500C21", "'01132005'!R11C2:R500C21", _
"'03032005'!R11C2:R500C21", "'05052005'!R11C2:R500C21")
ActiveSheet.PivotTables("PivotTable5").SmallGrid = False
ActiveSheet.PivotTables("PivotTable5").AddFields RowFields:="Row", _
ColumnFields:="Column"
Application.CommandBars("PivotTable").Visible = False
Range("A1").Select