title: VBA Excel - Delete 2 rows above the row with a specific keyword
body: <p>I have little insight in VBA, hence I need someone to help me with a script to achieve the outcome as stated in title.</p>
  
  <p>I need to extract specific rows from a log file that I have.</p>
  
  <p>Excerpt from actual log file in excel:</p>
  
  <pre><code>=====================================
  
  Encrypted file: C:\[specific path]      
  Algorithm picked for decryption: RC4        
  Status: Successfully decrypted!     
  
  Encrypted file: C:\[specific path]          
  File looks like it is not encrypted. Skipping ...       
  
  Encrypted file: C:\[specific path]      
  File could not be decrypted properly. Skipping ...      
  
  =====================================
  </code></pre>
  
  <p>It goes like this for about 90k rows. I need to get rid of all "Status: Successfully decrypted!" rows with 2 rows above it. 
  The final data that I need are only rows with skipped paths, that failed decryption.</p>
  
  <p>Each block of text in this log is followed by blank row.</p>
  
  <p>Tried the following one:</p>
  
  <p>Sub DeleteRowsBelow()</p>
  
  <pre><code>Dim x As Long
  Dim y As Long
  
  x = ActiveSheet.UsedRange.Rows.Count
  
  Cells.Find(What:="Macro", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
      :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
      False, SearchFormat:=False).Select
  y = Selection.Row + 1
  Rows(x &amp; ":" &amp; y).EntireRow.Delete
  </code></pre>
  
  <p>End Sub</p>
  
  <p>But it deletes all of the rows below a certain keyword, so that does not work for me.</p>
  
  <p>Then tried to incorporate the following into the above script:</p>
  
  <p>Rows("1:" &amp; Cells.Find("KEY WORD").Row - 1).Delete</p>
  
  <p>But also with little luck, and again it deletes all of the rows above a certain keyword.</p>