title: Making all pivot tables on one sheet mimic each other in terms of rows expanding and collapsing
body: <p>Alright, I'm new to VBA but I know this has to be possible. I spent a while coding android applications, but I wouldn't call myself nearly an expert, probably not even intermediate to be honest. However, alas, excel doesn't use java. Here's my problem:</p>
  
  <p>All I need is to make 6 other pivot tables on the same sheet mimic what I will call the primary pivot table. The only feature it needs to mimic though (for now I suppose) is when the primary expands/collapses, the others should follow suit.</p>
  
  <p>I'm guessing that the code will be similar to an onclicklistener in java and when the code "hears" a click for a collapse or expansion in the primary pivot table, it just applies that same collapse or expansion to the other six. The other 6 pivots will always have the same row labels, so an error in carrying over the "location" of the click from the primary to the others should never be a problem.</p>
  
  <p>I tried recording the expansion of one of the row labels in my pivot table and got this code back.</p>
  
  <pre><code>ActiveSheet.PivotTables("PivotTable1").PivotFields("Year").PivotItems("2005"). _
      ShowDetail = True
  </code></pre>
  
  <p>I know though, that this is the coding for executing that expansion (and ShowDetail = False would make it collapse). I think what I'm needing is like I said, a listener to "hear" the click of any expansion/collapse of the primary pivot table, a way to store/carry over information on what row label was clicked (the "location" of the click if you will), and then a generic version of the above code to execute on the other 6 using I'm guessing a for loop of sorts.</p>
  
  <p>Am I on the right track slash any help guys? Thanks a ton as always.</p>