K
ksnapp
Hello,
Is there a way I can make this code look for more than the firs
occurance?
Sub DelRows() ' deletes
Dim LastRow As Long
Dim nextname As Long
Dim RngDel As Range
Application.ScreenUpdating = False
With ActiveSheet
LastRow = .Cells(Rows.Count, "A").End(xlUp).Row
Set rng = .Range(Cells(1, "A"), Cells(LastRow, "A"))
End With
findme = "CHICKEN"
With rng
Set found = .Find(what:=findme, LookIn:=xlValues)
If Not found Is Nothing Then
nextname = found.End(xlDown).Row
Set RngDel = ActiveSheet.Range(found, Cells(nextname - 1, "A"))
RngDel.EntireRow.Delete
End If
End With
Application.ScreenUpdating = True
End Sub
so far I have been copying running the full sub a few times. But I'
like to wrap all my subs in to one big sub. Or that's the drea
atleas
Is there a way I can make this code look for more than the firs
occurance?
Sub DelRows() ' deletes
Dim LastRow As Long
Dim nextname As Long
Dim RngDel As Range
Application.ScreenUpdating = False
With ActiveSheet
LastRow = .Cells(Rows.Count, "A").End(xlUp).Row
Set rng = .Range(Cells(1, "A"), Cells(LastRow, "A"))
End With
findme = "CHICKEN"
With rng
Set found = .Find(what:=findme, LookIn:=xlValues)
If Not found Is Nothing Then
nextname = found.End(xlDown).Row
Set RngDel = ActiveSheet.Range(found, Cells(nextname - 1, "A"))
RngDel.EntireRow.Delete
End If
End With
Application.ScreenUpdating = True
End Sub
so far I have been copying running the full sub a few times. But I'
like to wrap all my subs in to one big sub. Or that's the drea
atleas