With emp.Cells(1, 1)
If Len(.Offset(0, -1).Value) > 0 Then
Manager = .Offset(0, -1).Value
Else
Manager = .Offset(0, -1).End(xlUp).Value
End If
End With
End Function
[/VBA]
This may get you started:
[vba]Function PivotInfo(rInput As Range) As String
Dim pCell As Excel.PivotCell
Dim pf As Excel.PivotField
Dim pi As Excel.PivotItem
Dim sOut As String
On Error Resume Next
Set pCell = rInput.PivotCell
On Error GoTo err_handle
If pCell Is Nothing Then
PivotInfo = "Not a pivot cell"
Else
Select Case pCell.PivotCellType
Case xlPivotCellValue 'Any cell in the data area (except a blank row).
If pCell.RowItems.Count Then
sOut = "Row items: " & vbLf
For Each pi In pCell.RowItems
sOut = sOut & pi.Parent.Name & ": " & pi.Value & vbLf
Next pi
End If
If pCell.ColumnItems.Count Then
sOut = sOut & "Column items: " & vbLf
For Each pi In pCell.ColumnItems
sOut = sOut & vbLf & pi.Parent.Name & ": " & pi.Value
Next pi
End If
sOut = sOut & pCell.PivotField.Name
Case Else
sOut = "Not a pivot data cell"
End Select
End If
PivotInfo = sOut
Exit Function
err_handle:
PivotInfo = "Unknown error"
End Function
[/vba]