I am trying to set up a routine to filter moderately large data sets. Think of it like daily rainfall for 60 years. I can get the data into a sheet where each row represents one year's worth of data, with the years entered in column 4.
One possible filter is to exclude everything outside of a certain range of years/totalrainfalls/percentileranks:
I give this a column containing the criterion (lCol) I care about and the max and min for that test and it works fine.
I would also like to be able to filter out years not on a user supplied list.
I am picking up this project after leaving it alone for a month, and I don't remember why I ever thought this code would work, but it doesn't, and I don't know how to proceed. I need an autofilter command or subroutine that will hide rows if the value in a particular column matches ANY of the values on a list.
Any suggestions?
One possible filter is to exclude everything outside of a certain range of years/totalrainfalls/percentileranks:
Code:
With rRange 'Filter, offset(to exclude headers) and delete visible rows
.AutoFilter Field:=lCol, Criteria1:="<" & minCrit, _
Operator:=xlOr, Criteria2:=">" & maxCrit
.Offset(1, 0).SpecialCells(xlCellTypeVisible).EntireRow.Delete
End With
I give this a column containing the criterion (lCol) I care about and the max and min for that test and it works fine.
I would also like to be able to filter out years not on a user supplied list.
Code:
With rRange 'Filter, offset(to exclude headers) and delete visible rows
.AutoFilter Field:=lCol, Criteria1:="<>" & yearArray, _
Operator:=xlFilterValues
.Offset(1, 0).SpecialCells(xlCellTypeVisible).EntireRow.Delete
End With
I am picking up this project after leaving it alone for a month, and I don't remember why I ever thought this code would work, but it doesn't, and I don't know how to proceed. I need an autofilter command or subroutine that will hide rows if the value in a particular column matches ANY of the values on a list.
Any suggestions?