Hi Experts!
Attached is some code I'm using to Filter one column in a Table and then delete the visible rows. I had difficulty with Selection.EntireRow.Delete but have replaced it with RngToDelete.Delete.
My problem is that the code stops and asks if I want to "Delete Entire Sheet Row?". I click "Yes" and it's fine. How can I have the code eliminate that step as well so it runs from start to finish without stopping?
This is very likely a no brainer for all of you. My attempt at code is below. Thank you!
Sub Filter_Sales1()
'
Dim RngToDelete As Range
Range("TblFTE").Select
ActiveSheet.ListObjects("TblFTE").Range.AutoFilter Field:=10, Criteria1:= _
Array("Business Development", "G&A", "Marketing", "R&D", "Solutions", "Support"), _
Operator:=xlFilterValues
Set RngToDelete = Selection.SpecialCells(xlCellTypeVisible)
RngToDelete.Delete
Range("TblFTE[[#Headers],[EE ID]]").Select
ActiveSheet.ShowAllData
End Sub
Thanks for posting. The code hung up on line 11 when I changed line 12. Thoughts?