S
Skeddy
I use a lot of Pivot tables at my work place, and runnig out of memory is a
big issue, as well as generating / "Show all pages" in the work sheet.
I want to build a macro that will allow me to run it, and for each field in
the pivot table, slect it and then print, and then go onto the next one.
The macro that I have set up at the moment is:
------------------------------------------
Sub pivot()
'
' pivot Macro
' Macro Recorded 09/03/2004 by Robert Sked
'
ActivateSheet.PivotTables("ShopStock").PivotFields("Shop Name").CurrentPage
= _
"Andover"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActivateSheet.PivotTables("ShopStock").PivotFields("Shop Name").CurrentPage
= _
"Boston"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActivateSheet.PivotTables("ShopStock").PivotFields("Shop Name").CurrentPage
= _
"Bedford"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
--------------------------------------------------
For each line that has the Shop Name, i.e. Boston, Bedford, Andover, these
are the drop down fields in the top of my pivot table. If I select a "Shop
Name" the Pivot table is updated to show me what stock they sold.
I have to attach a page if this to each Invoice that I do for the shop, and
this is why I am using the "Show All Pages" option, as I can then select the
100 or so tabs and sety up all the page headers and footers and then print
them all out.
The above macro does this but onlt using the main data as it were in the
work sheet. I'm looking for a way that I can get the macro to reapeat each
this for eveey "Shop Name" in the pivot table, and then end once it's done
them all.
Any thoughts ?
A friend has told me taht I would need to set up a variable for the "Shop
Name" and basically have it "+1" eadh time until it ends.
Once I get this set up, I would use this macro on multiple sheets when I
need to print out the data, so the range could be from 10 to 100 shops ech
time.
Any help/advice would be great !
Rob
http://skeddy.net
big issue, as well as generating / "Show all pages" in the work sheet.
I want to build a macro that will allow me to run it, and for each field in
the pivot table, slect it and then print, and then go onto the next one.
The macro that I have set up at the moment is:
------------------------------------------
Sub pivot()
'
' pivot Macro
' Macro Recorded 09/03/2004 by Robert Sked
'
ActivateSheet.PivotTables("ShopStock").PivotFields("Shop Name").CurrentPage
= _
"Andover"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActivateSheet.PivotTables("ShopStock").PivotFields("Shop Name").CurrentPage
= _
"Boston"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActivateSheet.PivotTables("ShopStock").PivotFields("Shop Name").CurrentPage
= _
"Bedford"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
--------------------------------------------------
For each line that has the Shop Name, i.e. Boston, Bedford, Andover, these
are the drop down fields in the top of my pivot table. If I select a "Shop
Name" the Pivot table is updated to show me what stock they sold.
I have to attach a page if this to each Invoice that I do for the shop, and
this is why I am using the "Show All Pages" option, as I can then select the
100 or so tabs and sety up all the page headers and footers and then print
them all out.
The above macro does this but onlt using the main data as it were in the
work sheet. I'm looking for a way that I can get the macro to reapeat each
this for eveey "Shop Name" in the pivot table, and then end once it's done
them all.
Any thoughts ?
A friend has told me taht I would need to set up a variable for the "Shop
Name" and basically have it "+1" eadh time until it ends.
Once I get this set up, I would use this macro on multiple sheets when I
need to print out the data, so the range could be from 10 to 100 shops ech
time.
Any help/advice would be great !
Rob
http://skeddy.net