View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
andresg1975 andresg1975 is offline
external usenet poster
 
Posts: 60
Default create macro that erases rows having blank cells and

it didn't work compile error


"Bob Umlas" wrote:

Try this:
Sub DeleteRows()
n=Activesheet.Usedrange.Rows.Count
For i=n to 1 step -1
if cells(i,15).value="----------" or cells(i,15).value=0 or
isblank(cells(i,15)) then rows(i).delete
Next
End Sub

Bob Umlas
Excel MVP

"andresg1975" wrote in message
...
let's say i have this:

column O

row 1 750
row 2 0
row 3 blank cell
row 4 ----------
etc

how can i create a macro that looks column O, delete rows that contain 0
values, blank cells, and ---------.

thanks for your help