Sub DynamicRange()
Dim sht As Worksheet
Dim LastRow As Long
Dim LastColumn As Long
Dim StartCell As Range
Set sht = Worksheets("Sheet1")
Set StartCell = Range("A1")
LastRow = sht.Cells(sht.Rows.Count, StartCell.Column).End(xlUp).Row
LastColumn = sht.Cells(StartCell.Row, sht.Columns.Count).End(xlToLeft).Column
sht.Range(StartCell, sht.Cells(LastRow, LastColumn)).Select
ActiveSheet.Range("A1").AutoFilter Field:=1, Criteria1:="Jan"`enter code here`
.Offset(1, 0).EntireRow.Delete
End Sub
I have tried to delete the rows but I am getting an error in the offset portion.