Deleting a row with 0 in column A

  • Thread starter Steven R. Berke
  • Start date
S

Steven R. Berke

In my worksheet Column A contains zeroes and other numbers with 0 in
them like 4500. I want to use a macro to delete those rows in column A
that just contain zeroes. There are other numbers in column A
containing 0 but these zeroes are part of at least a four digit number
Would you please help me write a macro to do this.
 
B

Bill LI

i=1
Do While cells(i,1)<>""
s=trim(cstr(cells(i,1)))
if instr(s,"0") then
rows(i).delete
else
i=i+1
end if
Loop
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top