View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Delete rows using VB


How about a nice for each loop that does NOT use SELECT. Or use
datafilterfilter for 0delete. Record it.

for each c in range("b11:b142")
if c=0 then rows(c.row).delete
next c

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Miguel" wrote in message
...
Hi,
I'm using a macro that delete rows that are blank. However, I want the
macro
to delete rows that are equal to zero. This is my program:

Sheets("Group-rep").Select
Range("B11:B142").Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.EntireRow.Delete
Range("A1").Select

what should I put on the SpecialCells?
Is there a way in the help option to find out what I should use?

Thanks
Miguel