View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default delete rows using VB

Something like:


Sub DeleteRows()
Dim lastrow as Long, i as Long
lastrow = Worksheets("sheet1").Cells(rows.count,"O").Row
for i = lastrow to 15 step -1
if isnumeric(cells(i,"O")) then
if cells(i,"O") = 0 then
rows(i).Delete
end if
end if
Next
End Sub



--
Regards,
Tom Ogilvy


"cindee" wrote in message
...
I know there's a million posts here on how to do this but since I'm such a
newbie, I don't know how to modify them to my explicit need.

I have a spreadsheet where I need to delete each ROW where the total in
Column O =0. I need to start the macro on Row 15 (due to headers) and
need
it to extend to at least row 2500. I can't sort or modify the data at all
prior to running the macro.

Please send detailed instructions on how to put this into a macro...

thank you

~cr