Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Identifying Pivot Table's Field

Hi all...

Is there a way (with vba) to find out if the active cell
or active range is part of a Pivot Table, and if so
retreiving the pivot table name?

Regards
Juan Sanchez
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Identifying Pivot Table's Field

Dim pt as PivotTable
for each pt in Activesheet.PivotTables
if Not intersect(pt.TableRange2,activeCell) is Nothing then
msgbox activeCell.Address & " is in " & pt.Name
Exit for
End if
Next

Change ActiveCell to selection, but that would only indicate if there is an
overlap. If you want totally contained

if Union(pt.TableRange2,Selection).Address = pt.TableRange2.Address then

' totally contained.

--
Regards,
Tom Ogilvy

"Juan Sanchez" wrote in message
...
Hi all...

Is there a way (with vba) to find out if the active cell
or active range is part of a Pivot Table, and if so
retreiving the pivot table name?

Regards
Juan Sanchez



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Identifying Pivot Table's Field

Tom thanks for your reply... I appreciate it...

Regards
Juan S
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's Custom Calculated Fields FARAZ QURESHI Excel Discussion (Misc queries) 1 September 21st 07 09:07 AM
how do I extend an existing pivot table's range Chris Smith Excel Discussion (Misc queries) 4 June 15th 07 06:02 PM
Can Multiple Range Pivot Table's field button's caption be changed Jac Excel Discussion (Misc queries) 1 June 10th 07 11:09 AM
Accessing Pivot Table's Data in VBA spjoseph0511 Excel Programming 3 November 14th 03 03:15 AM
Accessing Pivot Table's Data spjoseph0511[_2_] Excel Programming 1 November 13th 03 07:36 PM


All times are GMT +1. The time now is 07:17 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"