Hi,

Thanks for this.

I am a beginner in VBA, can you help me in putting the macro in the
sheet, coz i need to change the macro to suit my requirements.

Thanks in advance.

Regards,
Prashanth



On Apr 23, 2:34 am, Fabio_XL_Master <flnle...@gmail.com> wrote:
> Hi,
>
> It's possible using macros:
>
> Public Sub AplicaFiltros()
>     Dim auxWks As Worksheet
>     Dim auxPivot As PivotTable
>
>     On Error GoTo AplicaFiltros_ERRO
>
>     For Each auxWks In ThisWorkbook.Worksheets
>         For Each auxPivot In auxWks.PivotTables
>             'auxPivot.RefreshTable
>             auxPivot.PageFields("Ano").CurrentPage = ThisWorkbook.Names
> ("globalAno").RefersToRange.Value
>         Next
>     Next
>
> AplicaFiltros_EXIT:
>
>     Exit Sub
> AplicaFiltros_ERRO:
>    If Err.number = 1004 And Err.Description = "Unable to get the
> PageFields property of the PivotTable class" Then
>             Resume Next
>     End If
>
>     MsgBox Err.Description, vbCritical, "Erro ao aplicar os filtros
> ('" & auxWks.Name & "', '" & auxPivot.Name & "')!"
>     Resume AplicaFiltros_EXIT
> End Sub
>
> Regards!

--~--~---------~--~----~------------~-------~--~----~
-------------------------------------------------------------------------------------
Some important links for excel users:
1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com
2. Excel tutorials at http://www.excel-macros.blogspot.com
3. Learn VBA Macros at http://www.vbamacros.blogspot.com
4. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 

To post to this group, send email to excel-macros@googlegroups.com
If you find any spam message in the group, please send an email to:
Ayush Jain  @ jainayus...@gmail.com or
Ashish Jain @ 26may.1...@gmail.com
-------------------------------------------------------------------------------------
-~----------~----~----~----~------~----~------~--~---

Reply via email to