Originally Posted by
BrianMH
[vba]Option Explicit
Sub deleter()
Dim wkbkDel, wkbkMacro As Workbook
Dim wsDel As Worksheet
Dim strDw, strHeader, strSheet As String
Dim rFound As Range
strDw = Range("A2").Value
strHeader = Range("B2").Value
strSheet = Range("C2").Value
Set wkbkDel = Workbooks(strDw)
Set wsDel = wkbkDel.Sheets(strSheet)
Set rFound = wsDel.Cells.Find(strHeader, , , xlWhole, xlByColumns)
wsDel.Range(rFound.Offset(1, 0).Address & ":" & rFound.Offset(50000, 0).Address).Clear
End Sub
[/vba]
Try this. Now it will find the very first Cell by column with just A in it and delete the rows from just below it to 50000 below it. Its not perfect but you can edit it to the number of rows below it. Or we could add a variable. It assumes that book2 is open.