I have used the following UDF to allow users to Filter data, but I would like one Button to restore allData and Show "All" in Header row. Is this possible?
I do have a Button Macro that restores allData but will not Show "All" in header.
I do have a Button Macro that restores allData but will not Show "All" in header.
Code:
Function FilterCrit(Rng As Range) As String
Dim Filter As String
Filter = "All"
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
Select Case .Operator
Case xlAnd
Filter = Filter & " AND " & .Criteria2
Case xlOr
Filter = Filter & " OR " & .Criteria2
End Select
End With
End With
Finish:
FilterCrit = Filter
End Function
Last edited by a moderator: