Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
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.misc
external usenet poster
 
Posts: 2,979
Default determine the name of the selected pivot table

As answered in .programming:

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.

Thanks
Tim



--
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
Pivot Table - Grand Total for selected columns only KG Excel Discussion (Misc queries) 0 April 14th 07 09:50 PM
Selected Columns to be Used in External Data Source in Pivot Table Arj Excel Discussion (Misc queries) 3 February 25th 07 03:17 PM
Summin Pivot Table data from a date selected in the Page field John Excel Discussion (Misc queries) 1 November 10th 06 10:32 PM
Prevent new pivot table items from being selected Tom Excel Discussion (Misc queries) 3 August 10th 05 05:49 PM
Determine the location of an external source of pivot table? Pivot Novice Excel Worksheet Functions 3 June 1st 05 09:34 PM


All times are GMT +1. The time now is 03:30 AM.

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

About Us

"It's about Microsoft Excel"