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.
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.
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
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks