0
votes

I have a code that filter table by "#N/D!" criteria and then delete visible rows. It all worked well after i added to other sheet a Private Sub Worksheet_SelectionChange(ByVal target As Range). Now my macro when it reach below code it goes to this private sub and i dont know why? Someone can explain this?

ws.Range("$A$2:$AD$" & LastRow).SpecialCells _
(xlCellTypeVisible).EntireRow.Delete
1

1 Answers

1
votes

Try this:

Application.EnableEvents = False

ws.Range("$A$2:$AD$" & LastRow).SpecialCells(xlCellTypeVisible).EntireRow.Delete

Application.EnableEvents = True