Mega Code Archive

 
Categories / VisualBasic Script / Forms
 

Uses the Find method to reduce the number of cycles spent in VBA loops

Sub DeleteRows2()          Dim rngFoundCell As range          Application.ScreenUpdating = False          Set rngFoundCell = range("C:C").Find(What:="Mangoes")          Do Until rngFoundCell Is Nothing              rngFoundCell.EntireRow.delete              Set rngFoundCell = range("C:C").FindNext          Loop      End Sub