Hello all,
I am currently at lost... I can´t figure out how to do seemingly easy task of filter top n values in pivot table base on another cell value.
When I recorded macro in hope to see what I have to tweak in order to set up this filter... I was shocked... When I changed Value1 Macro didn´t run at all. I spent a few hours digging online for solution...
Unfortunately non of them fit my case...
I hope someone will help me with my problem
Here is my recorded macro:
Sub Top_Filter()
Range("B11").Select ´I clicked on first column in my pivot table
ActiveSheet.PivotTables("TOP").PivotFields( _
"[sumarizácia].[Celé meno].[Celé meno]").PivotFilters.Add2 Type:=xlTopCount, _
DataField:=ActiveSheet.PivotTables("TOP").CubeFields( _
"[Measures].[Súcet Prac. dni mimo práce]"), Value1:=20 ´when I changes Value:=20 to whatever number... macro didn´t run at all... I get this msg: Run-time error ´1004´
End Sub
I will be grateful for any help you can give me.
Thank you in advance.
Best regards,
Tomas
I am currently at lost... I can´t figure out how to do seemingly easy task of filter top n values in pivot table base on another cell value.
When I recorded macro in hope to see what I have to tweak in order to set up this filter... I was shocked... When I changed Value1 Macro didn´t run at all. I spent a few hours digging online for solution...
Unfortunately non of them fit my case...
I hope someone will help me with my problem
Here is my recorded macro:
Sub Top_Filter()
Range("B11").Select ´I clicked on first column in my pivot table
ActiveSheet.PivotTables("TOP").PivotFields( _
"[sumarizácia].[Celé meno].[Celé meno]").PivotFilters.Add2 Type:=xlTopCount, _
DataField:=ActiveSheet.PivotTables("TOP").CubeFields( _
"[Measures].[Súcet Prac. dni mimo práce]"), Value1:=20 ´when I changes Value:=20 to whatever number... macro didn´t run at all... I get this msg: Run-time error ´1004´
End Sub
I will be grateful for any help you can give me.
Thank you in advance.
Best regards,
Tomas