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