Guest User

Untitled

a guest
Jan 16th, 2019
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. Sub FilterCustomers()
  2.  
  3. Dim f As String: f = InputBox("Type the text you want to filter:")
  4.  
  5. With Sheets("Customers").PivotTables("Customers_PivotTable")
  6. .ClearAllFilters
  7. .PivotFields("Concatenation for filtering").CurrentPage = "*f*"
  8. End With
  9.  
  10. End Sub
  11.  
  12. Sub FilterCstomers()
  13.  
  14. Dim f As String: f = InputBox("Type the text you want to filter:")
  15.  
  16. Dim PvtItm As PivotItem
  17. With Sheets("Customers Pivot").PivotTables("Customers_PivotTable")
  18. .ClearAllFilters
  19. For Each PvtItm In .PivotFields("Concatenation for filtering").PivotItems
  20. If PvtItm.Name Like "*" & f & "*" Then
  21. PvtItm.Visible = True
  22. Else
  23. PvtItm.Visible = False
  24. End If
  25. Next PvtItm
  26. End With
  27.  
  28. End Sub
  29.  
  30. Sub FilterCstomers()
  31.  
  32. Dim f As String: f = InputBox("Type the text you want to filter:")
  33.  
  34. Dim PvtItm As PivotItem
  35. With Sheets("Customers Pivot").PivotTables("Customers_PivotTable")
  36. .ClearAllFilters
  37. For Each PvtItm In .PivotFields("Concatenation for filtering").PivotItems
  38. If PvtItm.Name Like "exemplo1" Then
  39. PvtItm.Visible = True
  40. Else
  41. If PvtItm.Name Like "exemplo2" then
  42. else
  43. PvtItm.Visible = False
  44. End If
  45. End If
  46. Next PvtItm
  47. End With
  48.  
  49. End Sub
Add Comment
Please, Sign In to add comment