View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default VBA Code with Pivot tables

Jeff,

Dim myPI As PivotItem

For Each myPI In ActiveSheet.PivotTables("PivotTable1").PivotFields ("Field Name").PivotItems
If IsError(Application.Match(CDbl(myPI.Name), ActiveSheet.Range("H:H"), False)) Then
myPI.Visible = False
Else
myPI.Visible = True
End If
Next myPI


The CDbl is needed in case your code numbers are numbers: you may need to play with that part of the
code. And, of course, you will need to change "PivotTable1" and "Field Name" to actual values.
You can get those by recording a macro....

HTH,
Bernie
MS Excel MVP


wrote in message
ups.com...
Need help/suggestions on my little problem. I have a basic pivot
table that list a job code number, say 500 in the list along with
their count as tallied via the piv. In column H, outside the piv, I
have a list of 'hot' job codes, there are are about 60 of these. What
I would like to do is have VBA only show, 'TRUE' of those items listed
in column H. And those that don't match to be set to FALSE.

Any ideas out there?

Thanks...!