Fair call. stasinek's correction to the formula works.
The other way you could do it is by adding a macro that amends the calculated field when your target cell changes.
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim KeyCells As Range, val As String
Set KeyCells = Range("D16")
If Not Application.Intersect(KeyCells, Range(Target.Address)) _
Is Nothing Then
val = "=" & Range("D16").Value
ActiveSheet.PivotTables("PivotTable1").CalculatedFields("Field1"). _
StandardFormula = val
End If
End Sub
Stephen
Bookmarks