Hello.
I want to make the following part of the code to work, but where it is, it isnt activating the filters:
It works when i insert between the "End If" and the"Next Ws" in the following code, but in this case it runs one time for each worksheet and i have about 20 ws in this file and it takes about 10 minutes until im able to use my file.
Here is how I wanted executing the filter only once: (this doesnt work)
And here the working code, but taking too long, aplying once for each ws verification:
Can you guys help me?
And if there was a way to make this filter work in all pivot tables in the file, would be even better. this is for only one pivot table in specific.
Example
Login: REG. SUL
password: 1111
Thanks!
I want to make the following part of the code to work, but where it is, it isnt activating the filters:
Code:
Sheets("Clientes").Select
With ActiveSheet.PivotTables("Tabela dinâmica15").PivotFields("Regional")
.PivotItems("REG. SUL - LUCIANO").Visible = True
End With
ActiveSheet.PivotTables("Tabela dinâmica15").PivotFields("GA").ClearAllFilters
It works when i insert between the "End If" and the"Next Ws" in the following code, but in this case it runs one time for each worksheet and i have about 20 ws in this file and it takes about 10 minutes until im able to use my file.
Here is how I wanted executing the filter only once: (this doesnt work)
Code:
Case "REG. SUL"
Feuilles = Array("Venda Programada", "Venda Saldos", "Entrada Diária", "Pilares Comerciais", "Redimensionamentos", "Clientes", "Filtros Aba ClientesGR", "Consulta por Grupo")
On Error Resume Next
Sheets("Clientes").Select
With ActiveSheet.PivotTables("Tabela dinâmica15").PivotFields("Regional")
.PivotItems("REG. SUL - LUCIANO").Visible = True
End With
ActiveSheet.PivotTables("Tabela dinâmica15").PivotFields("GA").ClearAllFilters
For Each Ws In ThisWorkbook.Worksheets
Pos = Application.Match(Ws.Name, Feuilles, 0)
If Pos <> 0 Then
Ws.Visible = True
Pos = 0
Else
Ws.Visible = xlSheetVeryHidden
Pos = 0
End If
Next Ws
Code:
Case "REG. SUL"
Feuilles = Array("Venda Programada", "Venda Saldos", "Entrada Diária", "Pilares Comerciais", "Redimensionamentos", "Clientes", "Filtros Aba ClientesGR", "Consulta por Grupo")
On Error Resume Next
For Each Ws In ThisWorkbook.Worksheets
Pos = Application.Match(Ws.Name, Feuilles, 0)
If Pos <> 0 Then
Ws.Visible = True
Pos = 0
Else
Ws.Visible = xlSheetVeryHidden
Pos = 0
End If
Sheets("Clientes").Select
With ActiveSheet.PivotTables("Tabela dinâmica15").PivotFields("Regional")
.PivotItems("REG. SUL - LUCIANO").Visible = True
End With
ActiveSheet.PivotTables("Tabela dinâmica15").PivotFields("GA").ClearAllFilters
Next Ws
Can you guys help me?
And if there was a way to make this filter work in all pivot tables in the file, would be even better. this is for only one pivot table in specific.
Example
Login: REG. SUL
password: 1111
Thanks!
Last edited: