VBA AutoFilter of a PivotTable

J

jxbeeman

Hello,
I'm having trouble with my Macro that Filters a Pivottable. What i'm trying
to do is sort the pivot table on the totals so i can highlight them and bold
them. If there is an better way to do this i would appreciate it. Below is
the code that was generated from recording the macro, problem is it dosen't
work when you try to replay it.

Selection.AutoFilter
ActiveSheet.Range("$A$4:$L$2150").AutoFilter Field:=13, Criteria1:="=1", _
Operator:=xlOr, Criteria2:="="

Thanks,
Josh
 
B

broro183

hi Josh,

Rather than using an autofilter would it work if you recorded a macr
of rightclicking on a cell in the "row fields" section of the pivo
table, choosing Field Settings - Advanced - Sort... which shoul
generate something like the below code?

Code
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top