Hi!
I have used the below code for a while, but a few days ago it suddenly stopped working. Can anybody please help me with a solution for this? It's not working on any computer it's tested on.
Where I want to use it in the Excel-file, I use "=DispCriteria(A31)" to get the filter criteria. But a few days ago it just started to show me the result <> in that cell. Anyone that can help a lost noob? Hehe
Best regards
Barebells
I have used the below code for a while, but a few days ago it suddenly stopped working. Can anybody please help me with a solution for this? It's not working on any computer it's tested on.
Code:
<code>Function DispCriteria(Rng As Range) As String
Dim Filter As String
Filter = ""
On Error GoTo Done
With Rng.Parent.AutoFilter
If Intersect(Rng, .Range) Is Nothing Then GoTo Done
With .Filters(Rng.Column - .Range.Column + 1)
If Not .On Then GoTo Done
Filter = .Criteria1
Select Case .Operator
Case xlAnd
Filter = Filter & " AND " & .Criteria2
Case xlOr
Filter = Filter & " OR " & .Criteria2
End Select
End With
End With
Done:
DispCriteria = Filter
End Function</code>
Where I want to use it in the Excel-file, I use "=DispCriteria(A31)" to get the filter criteria. But a few days ago it just started to show me the result <> in that cell. Anyone that can help a lost noob? Hehe
Best regards
Barebells