title: Filter cells using cell value as reference
body: <p>i need to filter an excel worksheet using a cell value as reference..
  Right now what i found was using vba, so this is my code</p>
  
  <pre><code>Private Sub Worksheet_Change(ByVal Target As Range)
     If (Intersect(Target, Range("f2")) Is Nothing) _
     Then
       Exit Sub
     End If
  
     Cells.AutoFilter Field:=2, Criteria1:=Range("f2").Value
  
  End Sub
  </code></pre>
  
  <p>But everytime i change value of cell f2 it hides all cells and excel crashes, somehow...
  So what i need is:
  Use cell f2 as reference for criteria, to filter data in range a1:d100, so that when value in cell f2 changes, a1:d100 only shows lines in which the the criteria is true...</p>
  
  <p>field 2 is the description of a product, like a computer, so every time i write in f2 the text "HP", it show only HP computers for example... </p>