View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Barry Jive[_2_] Barry Jive[_2_] is offline
external usenet poster
 
Posts: 1
Default Problems with filtering!!


Thanks for your help guys.

I had initially toyed with helper columns but I started getting lost in
my own sheet.

For anyone else's information, I ended up doing the following:

First, I inserted a helper column as suggested. The formula I used was

=IF(I3=CheckLists!F$1,1,IF(V3=CheckLists!H$1,1,0))
This looked at the value in one column (I3) first and compares it with
the criteria selected by the user for the filter. If it returns a TRUE,
the formula then looks at the second column and compares it. If it
returns a TRUE, the cell is attribtued a '1'; if not, the cell is
attributed a '0'.

I then created a userform with various Combo Box lists, containing
criteria to select for the filter. I set the ControlSource of each
Combo Box to a cell in a separate worksheet. In this example, this
worksheet is labelled 'CheckLists'. By referring back to this cell in
the formula, the criteria selected in the filter can be checked against
the data in the specified columns (I3 and V3).

Finally, I created a 'Search' button on the userform which activates
the Autofilter on the column containing the formula above. It filters
for any cells containing a '1', thus leaving the rows that contain the
criteria specified by the user.

Sorry the explanation's a bit of a ramble, but hopefully it will help
someone else.

Andrew


--
Barry Jive
------------------------------------------------------------------------
Barry Jive's Profile: http://www.excelforum.com/member.php...o&userid=24281
View this thread: http://www.excelforum.com/showthread...hreadid=378935