Uses the Find method to reduce the number of cycles spent in VBA loops: : Find « Forms « VBA / Excel / Access / Word






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

 








Related examples in the same category

1.Consider only cells that contain data in the form of numbers, text, and formulas
2.Working with Find and Replace
3.Continuing a Search with the FindNext Method and FindPrevious Method
4.Searching for and Replacing Formatting
5.Finding the Last Used Cell in a Column or Row
6.Ride the Range from the Bottom to Find Last Row
7.Find the First Non-Zero-Length Cell in a Range