1
我想標記的行(小計)不見了,這裏是我的數據透視表(我正在編寫一個宏)的代碼有什麼建議嗎? See picture here創建數據透視表宏 - 需要通過代碼刪除標記的行
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase, SourceData:=ActiveSheet.UsedRange).CreatePivotTable TableDestination:="", TableName:="PivotTable1", DefaultVersion:=xlPivotTableVersion10
ActiveSheet.PivotTableWizard TableDestination:=ActiveSheet.Cells(1, 1)
ActiveSheet.PivotTables("PivotTable1").AddFields RowFields:="Kostenstellen-Nr"
ActiveSheet.PivotTables("PivotTable1").AddFields RowFields:="Konto-Nr"
ActiveSheet.PivotTables("PivotTable1").AddFields RowFields:="Betrag Brutto"
ActiveSheet.PivotTables("PivotTable1").PivotFields("Kostenstellen-Nr").Orientation = xlRowField
ActiveSheet.PivotTables("PivotTable1").PivotFields("Konto-Nr").Orientation = xlRowField
ActiveSheet.PivotTables("PivotTable1").AddDataField ActiveSheet.PivotTables("PivotTable1").PivotFields("Betrag Brutto"), "Sum of Betrag Brutto", xlSum
謝謝!有用! –
@ L.J.G:很高興我能幫忙,但是請花一點時間來參觀遊覽:http://stackoverflow.com/tour,並發現如何接受答案! ;) – R3uK