Thread: Code problem
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Ruben Ruben is offline
external usenet poster
 
Posts: 31
Default Code problem

It works, thanks for helping!

Ruben



"Don Guillett" wrote:

Assumes a header row

for i= cells(rows.count,3).end(xlup).row to 2 step -1
If Cells (i,3)=800 AND Cells(i,3)<=900 Then rows(i).delete
next i

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Ruben" wrote in message
...
I would like to delete rows in column c for a criteria with a macro code.
But
I have a problem with my code, it doesn't work. Could anyone tell me
what's
wrong with my macro code? Thanks!

Sub filter()
Dim i As integer
i=0
Do until i=""
'my criteria is that all rows that contain a value between 800 and 900
have
to be deleted
If Cells (i,3).Value=800 AND Cells(i,3)<=900 Then EntireRow.delete
i=i+1
Loop

End sub