Hi all,
Happy Friday. I'm trying to record a macro that filters a table to any rows with a "D" in the designated row and then deletes the visible rows, unfiltering the table before ending the macro.
I am using the below but it is failing on the "Selection.EntireRow.Delete" command - is anyone able to recommend anything?
Thanks for your help in advance!
Sub Delete()
'
' Delete Macro
'
'
ActiveSheet.Range("$C$5:$T$3456").AutoFilter Field:=1, Criteria1:="<>"
Range("C786").Select
Range(Selection, Selection.End(xlDown)).Select
ActiveCell.Rows("1:8").EntireRow.Select
ActiveCell.Activate
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.EntireRow.Delete
ActiveSheet.Range("$C$5:$T$3453").AutoFilter Field:=1
End Sub
Happy Friday. I'm trying to record a macro that filters a table to any rows with a "D" in the designated row and then deletes the visible rows, unfiltering the table before ending the macro.
I am using the below but it is failing on the "Selection.EntireRow.Delete" command - is anyone able to recommend anything?
Thanks for your help in advance!
Sub Delete()
'
' Delete Macro
'
'
ActiveSheet.Range("$C$5:$T$3456").AutoFilter Field:=1, Criteria1:="<>"
Range("C786").Select
Range(Selection, Selection.End(xlDown)).Select
ActiveCell.Rows("1:8").EntireRow.Select
ActiveCell.Activate
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.EntireRow.Delete
ActiveSheet.Range("$C$5:$T$3453").AutoFilter Field:=1
End Sub