Capture en una macro lo siguiente:
Code
-
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 7/1/2003 by Telemetria
'
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase, SourceData:= _
Sheet1.Range(Cells(1, 1), Cells(7, 2))).CreatePivotTable _
TableDestination:=Sheet1.Range(Cells(2, 4), Cells(2, 4)), _
TableName:="PivotTable", DefaultVersion:=xlPivotTableVersion10
With ActiveSheet.PivotTables("PivotTable")
.ColumnGrand = False
.RowGrand = False
End With
ActiveSheet.PivotTables("PivotTable").PivotCache.RefreshOnFileOpen = True
ActiveSheet.PivotTables("PivotTable").AddFields RowFields:="d"
With ActiveSheet.PivotTables("PivotTable").PivotFields("v")
.Orientation = xlDataField
.Caption = "Average of v"
.Function = xlAverage
End With
ActiveWorkbook.ShowPivotTableFieldList = True
ActiveWorkbook.ShowPivotTableFieldList = False
Application.CommandBars("PivotTable").Visible = False
End Su
-
Y funciona bien, pero cuando oculto la hoja (y lo debo hacer) dond
esta contenida la tabla dinamica, este envia un error en la liena d
creacion de la tabla:
-ActiveWorkbook.PivotCaches.Add(SourceType. ... -
Como hago para que esto funcione incluso con la hoja oculta
tito
titon's Profile:
http://www.msusenet.com/member.php?userid)3
View this thread:
http://www.msusenet.com/t-187058044
Leer las respuestas