View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] marston.gould@alaskaair.com is offline
external usenet poster
 
Posts: 102
Default Conditionally Delete Cells From Named Range

I have a 1-D named range "MYRANGE" in a column
I'd like to loop through this range, comparing
each of the values in this range to a specific value.
If the values are not the same, I want to delete that cell
from the named range and then move the other cells up.

Here's what I have so far:

Set rMyRange = Range("MYRANGE")
testvalue = "100"
rMyRange.Select
For Each cell in Selection
If left(Cstr(cell.value),3) < testvalue Then
???? Select that cell ????
Selection.Delete Shift:=xlUp
End If
Next cell

Thanks in advance...