I have been using the code below for examining certain values for quite a while. I find the utility extremely useful. Unfortunately, it doesn’t work when a file contains more than 32000 rows. I get a “Run-time error 6: Overflow.” Does anyone know an alternative method that performs in reverse order and achieves the same results for sheets containing more than 32000. Your help is much appreciated. Thank you.
Sub LoopThrough()
Dim i As Integer
Dim lstCell As Long
lstCell = [a1048576].End(xlUp).Row
For i = lstCell To 2 Step -1
Set x = Cells(i, 1)
If x = "XYZ" Then x.EntireRow.Delete
Next
End Sub
Sub LoopThrough()
Dim i As Integer
Dim lstCell As Long
lstCell = [a1048576].End(xlUp).Row
For i = lstCell To 2 Step -1
Set x = Cells(i, 1)
If x = "XYZ" Then x.EntireRow.Delete
Next
End Sub