Excel VBA - Delete Rows Based on Criteria
<p>I have a report that I pull everyday that is placed in a very awekward format. It's contains a variable row count by 4 columns organized into unofficial tables based on the Name of each employee. </p>

<p>What I have is an employee name in column B preceded 2 blank rows above and followed by 1 blank row of data below. </p>

<p>What I want to accomplish is loop through the data, identify cells in column B &lt;> blank, delete the entire 2 rows below that cell, and delete the entire 1 row above that cell. </p>

<p>Below is what I have so far. not much:</p>

<pre><code>Sub test()

Dim currentSht As Worksheet
Dim startCell As Range
Dim lastRow As Long
Dim lastCol As Long
Dim i as integer

Set currentSht = ActiveWorkbook.Sheets(1)

Set startCell = currentSht.Range("A1")
lastRow = startCell.SpecialCells(xlCellTypeLastCell).Row
lastCol = startCell.SpecialCells(xlCellTypeLastCell).Column

For i = lastRow To 1
    If Cells(i, "B").Value &lt;&gt; "" Then


End Sub
</code></pre>