Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
This was more cumbersome than I realized (at least with Excel 2003). I found
this code on another forum and it works like a charm: Here's the link to the post http://lounge.windowssecrets.com/ind...owtopic=737024 Here's the post itself: You can create code that will format the pivot table automatically each time it is updated: - Right-click the sheet tab of the worksheet that contains the pivot table. - Copy/paste the following code into the worksheet module: Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable) With Target.TableRange1.Borders ..LineStyle = xlContinuous ..ColorIndex = xlColorIndexAutomatic ..Weight = xlThin End With End Sub - Modify as needed; you can change the style, color and width of the borders, for example. - The above code will apply borders to the entire pivot table except the page field (if present). - If you want to include the page field, use TableRange2 instead of TableRange1. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
excel pivot tables | Setting up and Configuration of Excel | |||
Building pivot tables in Excel 2007 based on existing pivot tables? | Excel Discussion (Misc queries) | |||
VBA Code with Pivot tables | Excel Discussion (Misc queries) | |||
In Excel, gridlines won't print--File,PageSetup,Sheet,Gridlines-- | New Users to Excel | |||
Excel Pivot Tables | Excel Discussion (Misc queries) |