請幫助您獲取用戶提供的篩選Excel中數據的條件,然後在宏中使用該條件追加額外的篩選條件。Excel Macro捕獲選定的篩選條件
我已經做到下面,直到現在。如何構建動態標準,如果存在多個條件,我們是否有任何功能來捕獲標準,然後追加?
With Rng.Parent.AutoFilter
If Intersect(Rng, .Range) Is Nothing Then GoTo Finish
With .Filters(Rng.Column - .Range.Column + 1)
If Not .On Then GoTo Finish
Filter = .Criteria1
Filter = Filter & " OR " & Cells(4, 10)
Select Case .Operator
Case xlAnd
Filter = Filter & " AND " & .Criteria2
Case xlOr
Filter = Filter & " OR " & .Criteria2
End Select
End With
https://stackoverflow.com/questions/9489126/in-excel-vba-how-do-i-save-restore-a-user-defined-filter –