+ Reply to Thread
Results 1 to 2 of 2

How to get or extract context tooltip of paticular cell in pivot table?

Hybrid View

  1. #1
    Registered User
    Join Date
    07-29-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    6

    How to get or extract context tooltip of paticular cell in pivot table?

    Is there any function to extract context tooltip display vlaue of a paticular cell in pivot table and display in a new colum. Please Help.

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: How to get or extract context tooltip of paticular cell in pivot table?

    this function will give the row and column field information for data cells
    Function PivotInfo(rngInput As Excel.Range) As String
       Dim pc                     As Excel.PivotCell
       Dim pf                     As Excel.PivotField
       Dim pi                     As Excel.PivotItem
       Dim sOut                 As String
       
       On Error Resume Next
       Set pc = rngInput.PivotCell
       On Error GoTo err_handle
       
       If pc Is Nothing Then
          PivotInfo = "Not a pivot cell"
       Else
          Select Case pc.PivotCellType
             Case xlPivotCellValue  'Any cell in the data area (except a blank row).
                sOut = pc.PivotField.Name & vbLf
    
                If pc.RowItems.Count Then
                   sOut = sOut & "Row: "
                   For Each pi In pc.RowItems
                      sOut = sOut & pi.value & "-"
                   Next pi
                   sOut = left$(sOut, Len(sOut) - 1) & vbLf
                End If
                If pc.ColumnItems.Count Then
                   sOut = sOut & "Column: "
                   For Each pi In pc.ColumnItems
                      sOut = sOut & pi.value & "-"
                   Next pi
                   sOut = left$(sOut, Len(sOut) - 1) & vbLf
                End If
             Case Else
                sOut = "Not a pivot data cell"
          End Select
       End If
       PivotInfo = sOut
       Exit Function
    
    err_handle:
       PivotInfo = "Unknown error"
    End Function
    Josie

    if at first you don't succeed try doing it the way your wife told you to

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Extract amount from pivot table
    By sagar007 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-21-2013, 03:03 AM
  2. Replies: 2
    Last Post: 12-28-2012, 03:54 AM
  3. Extract data from Pivot Table
    By Skipper Jones in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 08-01-2012, 07:45 PM
  4. Excel 2007 : Pivot table extract
    By Arazmus in forum Excel General
    Replies: 0
    Last Post: 03-31-2009, 05:48 AM
  5. How to extract the month in a Pivot Table
    By Mark in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-19-2006, 03:54 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1