Usually headers are in the first ROW, not in the first COLUMN, but anyway.
This will keep the data in the first column:
Sub keep1stcol()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Application.EnableEvents = False
On Error GoTo earlyexit
If Not Range("A1").Value = "" Then Rows("1:1").Insert
Cells.AutoFilter
ActiveSheet.Range(Cells(1, 1), Cells(1, Cells(1, Columns.Count).End(xlToLeft).Column)).AutoFilter Field:=6, Criteria1:="<>Complete", Operator:=xlAnd, Criteria2:="<>Finished"
Range("B1", ActiveCell.SpecialCells(xlLastCell)).Delete shift:=xlToLeft
Rows(1).EntireRow.Delete
earlyexit:
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
Application.EnableEvents = True
End Sub
and this will keep the first row
Sub keep1strow()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Application.EnableEvents = False
On Error GoTo earlyexit
Range("A2", ActiveCell.SpecialCells(xlLastCell)).AutoFilter
ActiveSheet.Range(Cells(1, 1), Cells(1, Cells(1, Columns.Count).End(xlToLeft).Column)).AutoFilter Field:=6, Criteria1:="<>Complete", Operator:=xlAnd, Criteria2:="<>Finished"
Range("A2", ActiveCell.SpecialCells(xlLastCell)).EntireRow.Delete
earlyexit:
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
Application.EnableEvents = True
End Sub
Please click the * below if this helps
Bookmarks