Manishakar
New Member
- Joined
- Sep 5, 2014
- Messages
- 2
Hi!
I wish to filter a Pivot based on the Value in Defined Cell.
I am not aware of VB Code. Tried to Copy a Code online but not working.
Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
Set rng=Me.Range("F1")
If Not Application.Intersect(Target, rng) Is Nothing Then
With Sheets("PS Pivot").PivotTables("PS PIVOT DP").PivotFields("Sale in Cans")
.ClearAllFilters
If Len(rng.Value)>0 Then .CurrentPage = rng.Value
End With
End If
End SUb
Wherein F1 is Cell whose Value should be considered for filtering the Pivot.
PS PIVOT is Sheet Name.
PS PIVOT DP is Pivot Table Name.
Sale in Cans is Field Name of Pivot Table.
All of them are in same sheet .
Please, help!
Thanks,
Mani
I wish to filter a Pivot based on the Value in Defined Cell.
I am not aware of VB Code. Tried to Copy a Code online but not working.
Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
Set rng=Me.Range("F1")
If Not Application.Intersect(Target, rng) Is Nothing Then
With Sheets("PS Pivot").PivotTables("PS PIVOT DP").PivotFields("Sale in Cans")
.ClearAllFilters
If Len(rng.Value)>0 Then .CurrentPage = rng.Value
End With
End If
End SUb
Wherein F1 is Cell whose Value should be considered for filtering the Pivot.
PS PIVOT is Sheet Name.
PS PIVOT DP is Pivot Table Name.
Sale in Cans is Field Name of Pivot Table.
All of them are in same sheet .
Please, help!
Thanks,
Mani