detect the filter mode ?
I'm not firm :-)
"Jamen Lone" schrieb im Newsbeitrag
...
How should I use this function in a sheet ?
I tried =TickedFilters() in cell A1, but it doesn't work.
sorry, but I'm firm in vba.
Jamen
"Peter T" <peter_t@discussions schrieb im Newsbeitrag
...
Sub test()
MsgBox TickedFilters(ActiveSheet)
End Sub
Function TickedFilters(ws As Worksheet) As Long
Dim cntOn As Long
Dim af As AutoFilter, f As Filter
If Not ws.AutoFilter Is Nothing Then
If ws.FilterMode Then
Set af = ws.AutoFilter
For Each f In af.Filters
If f.On Then cntOn = cntOn + 1
Next
End If
End If
TickedFilters = cntOn
End Function
As written the function doesn't prove any rows are hidden, if you need
that look for hidden rows in ws.AutoFilter.Range
Regards,
Peter T
"Jamen Lone" wrote in message
...
Hi all,
I need a function to see if the autofilter is defined (so activ) and the
rows are selected
I tried it by this
Function FilterOn()
If ActiveSheet.FilterMode = True Then
.. here should be "TRUE"
Else
.... here should be "FALSE"
End If
End Function
Can someone help me ?
--
Jamen
|