Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Looking for help with VBA code.
I would like to store in a variable the amount of child categories that are part of a given row or column. Are pivot table size details referenced in any functions? My user requires a formula inserted to the bottom of the pivot which will summarize the above data. This requires knowing the cell locations to put into these formulas. Thank you, JR |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If the ActiveCell is in the pivot table, the code below can get the
addresses of the pivot table row and column the cell is in. Option Explicit Sub GetPivotTableInfo() Dim rngDataRange As Range Dim rngRow As Range Dim rngColumn As Range Set rngDataRange = Application.ActiveCell.PivotField.DataRange Set rngRow = Intersect(Rows(ActiveCell.Row), rngDataRange) Set rngColumn = Intersect(Columns(ActiveCell.Column), rngDataRange) MsgBox "Row address: " & rngRow.Address MsgBox "Column address: " & rngColumn.Address End Sub Mark Jimmy wrote: Looking for help with VBA code. I would like to store in a variable the amount of child categories that are part of a given row or column. Are pivot table size details referenced in any functions? My user requires a formula inserted to the bottom of the pivot which will summarize the above data. This requires knowing the cell locations to put into these formulas. Thank you, JR |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks.
It works! Mark Driscol wrote: If the ActiveCell is in the pivot table, the code below can get the addresses of the pivot table row and column the cell is in. Option Explicit Sub GetPivotTableInfo() Dim rngDataRange As Range Dim rngRow As Range Dim rngColumn As Range Set rngDataRange = Application.ActiveCell.PivotField.DataRange Set rngRow = Intersect(Rows(ActiveCell.Row), rngDataRange) Set rngColumn = Intersect(Columns(ActiveCell.Column), rngDataRange) MsgBox "Row address: " & rngRow.Address MsgBox "Column address: " & rngColumn.Address End Sub Mark Jimmy wrote: Looking for help with VBA code. I would like to store in a variable the amount of child categories that are part of a given row or column. Are pivot table size details referenced in any functions? My user requires a formula inserted to the bottom of the pivot which will summarize the above data. This requires knowing the cell locations to put into these formulas. Thank you, JR |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Relative Values in Pivot Table | Excel Discussion (Misc queries) | |||
Help with converting a block of cells with Absolute and mixed references to relative references | Excel Worksheet Functions | |||
Relative growth in pivot table | Excel Discussion (Misc queries) | |||
Copy data from pivot table using relative reference | Excel Discussion (Misc queries) | |||
Relative references for condtional formatting within a Pivot Table | Excel Worksheet Functions |