- ©«¤l
- 9
- ¥DÃD
- 4
- ºëµØ
- 0
- ¿n¤À
- 13
- ÂI¦W
- 0
- §@·~¨t²Î
- window7
- ³nÅ骩¥»
- office 2010
- ¾\ŪÅv
- 10
- ©Ê§O
- ¤k
- ¨Ó¦Û
- HsinChu
- µù¥U®É¶¡
- 2013-10-14
- ³Ì«áµn¿ý
- 2014-6-26
|
¥»©«³Ì«á¥Ñ GBKEE ©ó 2013-10-16 14:46 ½s¿è
§Q¥Î VBA ¼g PIVOT µLªk«ü©wCREATE ¨ì SHEET 2, ½Ð°Ý¬Oþùئ³°ÝÃD.
·|¤@ª½¥d¦b
Set PT = PTCache.CreatePivotTable _
(TableDestination:=sheets("pivot2").range("A1"), TableName:="PivotTable1")
========================================
Sub crePT()
Dim PTCache As PivotCache
Dim PT As PivotTable
Windows("AA").Activate
'Sheets("Sheet2").Name = "Pivot2"
Set used1 = Sheets("details").UsedRange
Set PTCache = ThisWorkbook.PivotCaches.Add _
(SourceType:=xlDatabase, _
SourceData:=used1)
Set PT = PTCache.CreatePivotTable _
(TableDestination:=sheets("pivot2").range("A1"), TableName:="PivotTable1")
With PT
.PivotFields("Product").Orientation = xlRowField
.PivotFields("account").Orientation = xlRowField
.PivotFields("FSE/FPE").Orientation = xlRowField
.PivotFields("OT").Orientation = xlDataField
End With
Application.CommandBars("PivotTable").Visible = False
End Sub |
|