title: VBA for hiding rows based on value
body: <p>I have written a VBA code to select any row where a special value appears in a chosen column. </p>
  
  <pre><code>`Sub test()
  vonZeile = 4    ' first row
  bisZeile = Cells(vonZeile, 7).End(xlDown).Row
  Spalte = 7   ' column G
  Markierung = False
  For Zeile = bisZeile To vonZeile Step -1
    If (Cells(Zeile, Spalte).Value = "Werkstatt") Then
      If Markierung Then
        Union(Selection, Rows(Zeile)).Select
      Else
        Rows(Zeile).Select
        Markierung = True
      End If
    End If
  Next Zeile
  If Zeilen &gt; "" Then Selection.Delete Shift:=xlUp
  End Sub`
  </code></pre>
  
  <p>This might not be the prettiest but it works pretty well and very fast. </p>
  
  <p>Now I would like to change this code so that the rows with the specific value are not only selected but cut out or hidden. 
  I couldn't figure out how to change this code to get this. </p>
  
  <p>I have a different code that does delete all these rows but it lats an eternity. But it should be much faster when all the rows with the specific value would be deleted at once.</p>
  
  <p>Shouldn't there be a way to just change the <code>.Select</code> part in the code to maybe <code>Hidden</code> or <code>Delete</code>? 
  This is just a guessing as I am not very familiar with VBA coding.</p>
  
  <p>Very happy to get some advice on this matter. 
  Thanks</p>