ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA: returning subtotal range of pivot tables????? (https://www.excelbanter.com/excel-programming/357267-vba-returning-subtotal-range-pivot-tables.html)

doog

VBA: returning subtotal range of pivot tables?????
 

I need my pivot tables to retain formatting after they are refreshed.
So, I have a VBA module that does this by applying custom styles. It
returns (calls) particular ranges in the pivot table and applys a
particular custom style to each range. But, I can't figure out how to
do this to subtotals. How do you return (select/call) a subtotal range
from a pivot table???

I found this on the net but it does nothing for subtotals!:

Sub ApplyStyles()
With ActiveSheet.PivotTables(1)
TableRange1.Style = "PivLabel" '\ style for cells above row area of
table
DataBodyRange.Style = "PivData" '\ style for data area
RowRange.Style = "PivRow" '\ row area
ColumnRange.Style = "PivColumn" '\ column headings
TableRange1.EntireColumn.AutoFit '\ adjust row and cell heights to fit
new style
End With
End Sub


--
doog
------------------------------------------------------------------------
doog's Profile: http://www.excelforum.com/member.php...o&userid=32880
View this thread: http://www.excelforum.com/showthread...hreadid=526813



All times are GMT +1. The time now is 12:37 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com