How to find values between a range and delete

Solved/Closed
weenie - Sep 17, 2010 at 07:03 PM
 weenie - Nov 4, 2010 at 05:18 PM
Hello,

I don't know where to begin in writing this macro. If i have column J with values & I want to search for any values BETWEEN ranges of 1.00E+17 to 1.00E+38 and delete rows when it finds those values.

Thanks
Irene


2 responses

TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 555
Sep 21, 2010 at 09:51 AM
Hi Irene,

Try this macro:
Sub test()
Set MyRng = Range("A1:A20")
For Each cell In MyRng
    If cell.Value > 1E+17 And cell.Value < 1E+38 Then
    cell.EntireRow.Delete
        End If
    Next
End Sub

You might want to change the range and replace the < and > symbols by <= and >=.

Best regards,
Trowa
0
Thank You...it worked.
0