ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] pivot µLªk«ü©w Sheet

[µo°Ý] pivot µLªk«ü©w Sheet

¥»©«³Ì«á¥Ñ 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
Anny

¦^´_ 1# anny8888
1. Àˬdused1½d³ò¤º¬O§_¨CÄæ­º¦C³£§t¼ÐÃD¦WºÙ¡C
2. ¼Ï¯Ã¤ÀªRªí¤£¥i­«Å|¡AÀˬdsheets("pivot2").range("A1")¬O§_¦³¤w¦s¦b¼Ï¯Ã¤ÀªRªí¡A­Y¦³»Ý¥ý§R°£¡C

TOP

¦^´_ 2# stillfish00
¤w½T»{
1. USED1 ªº­º¦C, §¡¦³¸ê®Æ
2.«ü©wªºSHEET¤¤§¹¥þ¨S¦³¸ê®Æ

ÁÂÁÂ.
Anny

TOP

¦^´_ 3# anny8888
ªþ¤WÀÉ®×/®×¨Ò¬Ý¬Ý
°õ¦æ®É¬O§_¸ó¤u§@ï?

TOP

¦^´_ 1# anny8888

'Sheets("Sheet2").Name = "Pivot2"³o­Ó»¡©ú¤FpÀ³¸Ó¬O¤j·¢P,¤£¬Opivot2

TOP

        ÀR«ä¦Û¦b : §g¤l¬°¥Ø¼Ð¡A¤p¤H¬°¥Øªº¡C
ªð¦^¦Cªí ¤W¤@¥DÃD