PDA

View Full Version : PivotTable extraction



kellyhell
12-03-2012, 01:46 AM
Good Morning

I have the following bit of code which works great, however, it only extracts the data from column B of the pivot table. I would like it to loop through all the columns until it hits the "Grand Total" then stops.

Sub ExpandPivot()

RowNbr = 4
Do While Range("A" & RowNbr) <> "Grand Total"
Var = Range("A" & RowNbr).Value
Range("B" & RowNbr).Select
Selection.ShowDetail = True
Application.ActiveSheet.Name = Var
Sheets("Breakdown").Select
RowNbr = RowNbr + 1
Loop

End Sub

Any ideas or pointers?

TIA

Paul_Hossler
12-03-2012, 02:49 PM
1. Not sure what you mean by 'extracts'?

2. Why rename the ActiveSheet?

3. An example workbook with the before and after might be helpful

4. Also, what is it exactly you're trying to do?

Paul