Hey i am currently using the following code,
and I would like to sum the values which are in the second column, i am
currently evaluating the first column,
==>
Sub PivotShowItemAllVisible()
Dim pt As PivotTable
Dim pf As PivotField
Dim pi As PivotItem
Application.ScreenUpdating = False
Application.DisplayAlerts = False
On Error Resume Next
Set pt = ActiveSheet.PivotTables("months_to_incorp_pivot")
Dim ECWI3Months As Integer
ECWI3Months = 0
For Each pf In pt.RowFields
pf.AutoSort xlManual, pf.SourceName
For Each pi In pf.PivotItems
Application.StatusBar = "Evaluating : " & pi.Name
If (pi.Value <= 3) Then
<==
THIS is where i want to sum the second column
==>
ECWI3Months = pi.Value + ECWI3Months
End If
pi.Visible = True
Next pi
Next pf
ActiveSheet.Range("D4:D4").Value = ECWI3Months
ActiveSheet.Range("B4:B4").Value = pt.GetData(pt.GrandTotalName)
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
<==
Using the folowing code how would i go about doing this ?
Regards,
Alexandre Brisebois
Bookmarks