Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,979
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
determine in datasource or pivot table rodchar Excel Discussion (Misc queries) 0 March 23rd 09 05:34 PM
determine the name of the selected pivot table Tim879 Excel Discussion (Misc queries) 1 September 23rd 07 05:02 PM
determine if value in pivot table geebee Excel Programming 0 September 18th 07 07:48 PM
How to determine order of row fields in pivot table Joerg Mochikun Excel Programming 1 August 27th 07 05:35 AM
Determine If Pivot Table Exists ridawg Excel Programming 4 September 25th 06 08:55 PM


All times are GMT +1. The time now is 11:47 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"