簡體   English   中英

數據透視表使用Excel VBA展開和減去或顯示/隱藏詳細信息

[英]Pivot table expand and substract or Show/Hide Details using Excel VBA

我試圖使用以下命令隱藏數據透視表列的詳細信息。 有人可以告訴我這個錯誤嗎?

謝謝。

     For Each c In Range("A1:A20000")
         With c
             If Left(.Value, 2) = "FA" Then ActiveSheet.PivotTables("PivotTable1").PivotFields("Ref 1").PivotItems( _
        "*").ShowDetail = False
             End With
     Next c

終於找到了愚蠢的錯誤

Dim c As Range
     For Each c In myfile.Sheets(3).Range("A1:A20000")
         With c
            If Left(c.Value, 2) = "FA" Then ActiveSheet.PivotTables(1).PivotFields("Ref 1").PivotItems(c.Value).ShowDetail = False
        End With
     Next

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM