Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All,
In VBA script when it is running, is there a way to select any cell on the pivot table and then obtain the name of the pivot table so that I can manipulate it ? Thanks. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Me.PivotTables("PivotTable1").TableRange2) Is Nothing Then MsgBox Target.Address & " is part of PivotTable1" End If End Sub -- __________________________________ HTH Bob "ch" wrote in message ... Hi All, In VBA script when it is running, is there a way to select any cell on the pivot table and then obtain the name of the pivot table so that I can manipulate it ? Thanks. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
To get the name of the pivot table for the active cell:
'======================== Sub GetPTName() Dim pt As PivotTable On Error Resume Next Set pt = ActiveCell.PivotTable If pt Is Nothing Then MsgBox "Active cell is not in a pivot table" Else MsgBox ActiveCell.PivotTable.Name End If Set pt = Nothing End Sub '===================== ch wrote: Hi All, In VBA script when it is running, is there a way to select any cell on the pivot table and then obtain the name of the pivot table so that I can manipulate it ? Thanks. -- Debra Dalgleish Contextures www.contextures.com/tiptech.html Blog: http://blog.contextures.com |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Debra, this works just fine.
"Debra Dalgleish" wrote: To get the name of the pivot table for the active cell: '======================== Sub GetPTName() Dim pt As PivotTable On Error Resume Next Set pt = ActiveCell.PivotTable If pt Is Nothing Then MsgBox "Active cell is not in a pivot table" Else MsgBox ActiveCell.PivotTable.Name End If Set pt = Nothing End Sub '===================== ch wrote: Hi All, In VBA script when it is running, is there a way to select any cell on the pivot table and then obtain the name of the pivot table so that I can manipulate it ? Thanks. -- Debra Dalgleish Contextures www.contextures.com/tiptech.html Blog: http://blog.contextures.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to create pivot table from existing pivot table in excel 2007 | Excel Discussion (Misc queries) | |||
Copying values from pivot table to cells outside pivot table | Excel Discussion (Misc queries) | |||
Filter lines with Pivot table and non Pivot table columns | Excel Discussion (Misc queries) | |||
Filter lines containing pivot table and non pivot table data | Excel Worksheet Functions | |||
Help required with setting up a pivot table with the source on sheet1 to have the pivot table created on sheet called "report" | Excel Programming |