G
Grek
Hi,
I have some difficulties to delete a row when the value in cell o
column A doesn't match a criteria.
For instance, in A1 the value is 100, A2 is 110, A3 is 120, A4 is 13
and A5 is 140.
I would like to do something like "browse all the values in column
and delete very row with value different that 100 and 120" ---> row A
and A4 should be deleted.
I tried something like that but it didn't work :
***********************************
Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
Set RangeClass = Range(Selection, Selection.End(xlDown))
For Each Cell In RangeClass
If Cell.Value <> 100 Or 120 Then
Cell.EntireRow.Delete
End If
Next Cell
************************************
Could you please help me ?
Many thanks in advance,
Gregor
I have some difficulties to delete a row when the value in cell o
column A doesn't match a criteria.
For instance, in A1 the value is 100, A2 is 110, A3 is 120, A4 is 13
and A5 is 140.
I would like to do something like "browse all the values in column
and delete very row with value different that 100 and 120" ---> row A
and A4 should be deleted.
I tried something like that but it didn't work :
***********************************
Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
Set RangeClass = Range(Selection, Selection.End(xlDown))
For Each Cell In RangeClass
If Cell.Value <> 100 Or 120 Then
Cell.EntireRow.Delete
End If
Next Cell
************************************
Could you please help me ?
Many thanks in advance,
Gregor