Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 29
Default VBA Code with Pivot tables

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...!

  #2   Report Post  
Posted to microsoft.public.excel.misc
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...!



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,886
Default VBA Code with Pivot tables

Hi Jeff

Why not put an extra column in your source data titled Hot.
In the column enter
=IF(ISNA(MATCH(D2,$G$1:$G$60,0)),"","Hot")

This formula assumes your Job code is in D, and your list of "hot" codes
is in G1 to G60.
Amend as necessary.
Drag the Hot field to the Page area of the PT, and filter for Hot.

--
Regards

Roger Govier


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...!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Average Calculations from Pivot Tables - Get Pivot Data? Calc Fiel westy Excel Worksheet Functions 5 March 10th 07 01:31 AM
build a pivot table from multiple other pivot tables. Gordo Excel Discussion (Misc queries) 1 December 11th 06 08:19 PM
Pivot Tables -changing datasource for exsting Pivot Table kfschaefer Setting up and Configuration of Excel 0 May 30th 06 06:36 PM
how do I consolidate multiple pivot tables into one pivot table? pkahm Excel Discussion (Misc queries) 0 April 20th 06 09:48 PM
How does the term 'pivot' apply to Excel's Pivot tables and Pivot. stvermont Excel Discussion (Misc queries) 1 February 17th 05 01:34 AM


All times are GMT +1. The time now is 05:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"