如何解决pt.PivotItems调试错误?

时间:2019-03-04 16:16:12

标签: excel vba

在下面的行(pi.Visible = False)下,当我们尝试运行报告时,这会不断记录调试错误。

Set pt = Worksheets ("Design Type of Work") .PivotTables("PivotTable1")
Set pf = pt.PivotFields ("Date Design Sent for Builder Approval")
pt.ManualUpdate = True
    For Each pi In pf.PivotItems
    If Left(pi, 4) = thisyr Then
    pi.Visible = True
    Else
    pi.Visible = False
    End If
    Next pi
pt.ManualUpdate = False
End Sub

0 个答案:

没有答案