Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
determine the name of the selected pivot table
does anyone know how to determine the name of the pivot table the user
has selected. I have code I want to run against the selected pivot table however the name of the pivot table is not constant nor is it always the first pivot table on a given sheet. Thanks Tim |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
determine the name of the selected pivot table
You can test if the active cell is in a pivot table, and if it is, get
the pivot table name: Sub test() Dim pt As PivotTable On Error Resume Next Set pt = ActiveCell.PivotTable If pt Is Nothing Then Debug.Print "Active cell is not in a pivot table" Else Debug.Print ActiveCell.PivotTable.Name End If Set pt = Nothing End Sub Tim879 wrote: does anyone know how to determine the name of the pivot table the user has selected. I have code I want to run against the selected pivot table however the name of the pivot table is not constant nor is it always the first pivot table on a given sheet. -- Debra Dalgleish Contextures http://www.contextures.com/tiptech.html |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
determine in datasource or pivot table | Excel Discussion (Misc queries) | |||
determine the name of the selected pivot table | Excel Discussion (Misc queries) | |||
determine if value in pivot table | Excel Programming | |||
How to determine order of row fields in pivot table | Excel Programming | |||
Determine If Pivot Table Exists | Excel Programming |