View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default Referring to all pivot tables in a workbook

While you are traversing all of the sheets and all of the pivot tables in the
sheets you are not passing the reference to the pivot table you find to the
formatting procedures. Your formatting procedures need to be modified to
accept a pivot table to be formatted.

For Each ws In ActiveWorkbook.Worksheets
For Each pt In ws.PivotTables
Call Format_Grouping_Titles(pt)
Call Format_Columns_RC(pt)
Call Format_ThinLines_5(pt)
Call Format_ThinLines_6(pt)
Call Format_ThinLines_7(pt)
Call Format_ThinLines_9(pt)
Call Format_Titles_1(pt)
Call Anamolies(pt)
Call Home(pt)
Next pt
Next ws

--
HTH...

Jim Thomlinson


"klysell" wrote:

Hi,

I have many worksheets each with three pivot tables residing on them. I
would like call up formatting procedures to apply identical formatting to
each group of three pivot tables without applying the same formatting to
worksheets that don't contain pivot tables. The first 5 sheets in my workbook
don't contain pivot tables while the 6th and beyond all do. Here is the code
that I have so far:

For Each ws In ActiveWorkbook.Worksheets
For Each pt In ws.PivotTables
Call Format_Grouping_Titles
Call Format_Columns_RC
Call Format_ThinLines_5
Call Format_ThinLines_6
Call Format_ThinLines_7
Call Format_ThinLines_9
Call Format_Titles_1
Call Anamolies
Call Home
Next pt
Next ws

What am I doing wrong? This code only applies the pivot table formatting sub
procedures to the Summary sheet which doesn't even have a pivot table. How
about starting the formatting procedures on the worksheet starting after the
Summary sheet and applying this formatting to all worksheets that follow? The
Summary sheet is the 5th sheet in my workbook, so I'd like to start this
formatting on the 6th sheet and beyond. Any pointers?

Thanks in advance!


--
Kent Lysell
Financial Consultant
Ottawa, Ontario
W: 613.948-9557