View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Kurt Barr Kurt Barr is offline
external usenet poster
 
Posts: 25
Default delete rows which have a one in them

You are getting the compile error because you've named your macro the same
thing as you named the variable. Change one or the other, and it should work.

"kyle" wrote:

Don,

the final row still isn't working, i've uploaded a picture to show you what
i mean

http://i87.photobucket.com/albums/k1...icture3-10.png

"Don Guillett" wrote:


finalrow = celss(rows.count, 1).end(xlup).row

finalrow = cells(rows.count, 1).end(xlup).row

endif

end if


sub delete()
for i = cells(rows.count, 1).end(xlup).row to 2 step-1
if cells(i, 8) = 1 then rows(i).delete
next i
end sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"kyle" wrote in message
...
i've got this code built that will delete a row if there is a one in
column h
but it's not working

sub delete()

finalrow = celss(rows.count, 1).end(xlup).row

for i = finalrow to 2 step -1
if cells(i, 8) = 1 then
cells(i, 1).entirerow.delete
endif
next i
end sub

it doesn't work, what do you think is wrong?


.