I want filter revenue between two numbers for a large amount of customer.
I can record a macro that looks like this
Sub SegmentD()
'
' SegmentD Macro
' Segment D udvælges
'
'
Range("B25").Select
ActiveSheet.PivotTables("PivotTable2").PivotFields("Kundenummer").PivotFilters. _
Add Type:=xlValueIsBetween, DataField:=ActiveSheet.PivotTables( _
"PivotTable2").PivotFields("Sum of Omsætning 2012"), Value1:=0, Value2:= _
2917
Application.Goto Reference:="SegmentD"
End Sub
What I would like to is that Value1 and Value2 refers to two cells representing the two values, instead of beeing fixed numbers.
The cells in this case are in O14 and P14
How do I do that
Bookmarks