Enzo_Matrix
Board Regular
- Joined
- Jan 9, 2018
- Messages
- 113
I have a code to delete specific rows depending on whether or not the cell value is set to "Void".
There is a daily dump that can add anywhere from 10-50 rows to my table and I'm trying to get this to run automatically as the data in my table changes. After some Googling I found this but it does not work run automatically.
Code:
Sub DeleteRows() Dim c As Range
Dim SrchRng
Set SrchRng = ActiveSheet.Range("E1", ActiveSheet.Range("E65536").End(xlUp))
Do
Set c = SrchRng.Find("Void", LookIn:=xlValues)
If Not c Is Nothing Then c.EntireRow.Delete
Loop While Not c Is Nothing
End Sub
There is a daily dump that can add anywhere from 10-50 rows to my table and I'm trying to get this to run automatically as the data in my table changes. After some Googling I found this but it does not work run automatically.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)If Target.Address = "$A$2" Then
Dim c As Range
Dim SrchRng
Set SrchRng = ActiveSheet.Range("E1", ActiveSheet.Range("E65536").End(xlUp))
Do
Set c = SrchRng.Find("Void", LookIn:=xlValues)
If Not c Is Nothing Then c.EntireRow.Delete
Loop While Not c Is Nothing
End If
End Sub