19-11-20 02:04 AM
Answered! Go to Answer.
20-11-20 12:31 AM
sheet.PivotTables(1).PivotFields(4).PivotFilters.Add2 Type:=xlCaptionEquals, Value1:="611"
19-11-20 03:33 PM
sheet.range(varUsedRange ).AutoFilter (Field:=4, Criteria1:="611", Operator:=2, Criteria2:="SecondFilterValue")
(2 = xlOr)19-11-20 04:20 PM
19-11-20 05:09 PM
sheet.Range("A2").Select
excel.Selection.AutoFilter Field:=4, Criteria1:="611"
------------------------------19-11-20 08:25 PM
20-11-20 12:31 AM
sheet.PivotTables(1).PivotFields(4).PivotFilters.Add2 Type:=xlCaptionEquals, Value1:="611"
20-11-20 01:50 AM
Dim ss, ds As Object
Dim excel, sheet As Object
Dim i As Decimal
Try
ss = GetWorksheet(handle, workbookname, worksheetname)
ss.Activate()
excel = ss.Application
sheet = excel.ActiveSheet
'sheet.PivotTables(1).PivotFields("Conta do R").PivotFilters.Add (Type:=15, Value1:= "631*", Value2:= "611*")
With sheet.PivotTables(1).PivotFields("Conta do R")
For i=1 to .PivotItems.Count
If left(.PivotItems(i).Name, 3) = "631" Or left(.PivotItems(i).Name, 3) = "611" Then
.PivotItems(i).Visible = True
Else
.PivotItems(i).Visible = False
End If
Next i
End With
Success = True
Catch e As Exception
Success = False
Message = e.Message
Finally
ss = Nothing
ds = Nothing
excel = Nothing
sheet = Nothing
End Try