I have this function to display filtered column criteria in a cell, which works for 2 criteria, but I need to extend to 10 criteria and my VBA's inadequate - can anyone point me in the right direction please?
Function AutoFilter_Criteria(Header As Range) As String
Dim strCri1 As String, strCri2 As String, strCri3 As String
Application.Volatile
With Header.Parent.AutoFilter
With .Filters(Header.Column - .Range.Column + 1)
If Not .On Then Exit Function
strCri1 = .Criteria1
If .Operator = xlOr Then
strCri2 = " , " & .Criteria2
End If
End With
End With
AutoFilter_Criteria = UCase(Header) & ": " & strCri1 & strCri2
End Function
Function AutoFilter_Criteria(Header As Range) As String
Dim strCri1 As String, strCri2 As String, strCri3 As String
Application.Volatile
With Header.Parent.AutoFilter
With .Filters(Header.Column - .Range.Column + 1)
If Not .On Then Exit Function
strCri1 = .Criteria1
If .Operator = xlOr Then
strCri2 = " , " & .Criteria2
End If
End With
End With
AutoFilter_Criteria = UCase(Header) & ": " & strCri1 & strCri2
End Function