Hi,
I am filtering my data, based on user input. But I need a way to reset
the filters, here is some example code. Say I filter by one, then
reset the data by using Spreadsheet1.ActiveSheet.ShowAllData then they
try to filter by "2". Problem is that it includes "1" and "2". How
can I fix this?
Thanks
With Me.Spreadsheet1.ActiveWorkbook.ActiveSheet
Set owcAutoFilter = .autoFilter
With owcAutoFilter
With .Filters(1).Criteria
.FilterFunction = ssFilterFunctionInclude
.Add "1"
End With
.Apply
End With
Set owcAutoFilter = Nothing
End With
Rishi Dhupar - 25 Jan 2006 17:24 GMT
Just to add to this, I tried to shut the autofilter off and then on
again to clear the filter doesn't seem to work. Using this code
'OFF
Me.Spreadsheet1.ActiveSheet.AutoFilterMode = False
'ON
Me.Spreadsheet1.ActiveSheet.UsedRange.autoFilter
Crowbar - 25 Jan 2006 17:34 GMT
If you just want to reset one filter: -
Selection.AutoFilter Field:=1
you will have to change the field number as appropiate
Rishi Dhupar - 25 Jan 2006 17:34 GMT
Errr... love it when I figure it out after I post. I was saving my
input in an array and wasn't resetting it.
thanks have a nice day.