View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Deleting non empty rows

Hi Jan,

Try:

Sub Tester()
On Error Resume Next
With Range("C:C")
.SpecialCells(xlCellTypeConstants).Delete
.SpecialCells(xlCellTypeFormulas).Delete

On Error GoTo 0
End With

End Sub

---
Regards,
Norman


"Jan Kronsell" wrote in message
...
This code deletes the row, if the cell in column C IS empty.

Sub SletBlank()
On Error Resume Next
Columns("C:C").SpecialCells(xlCellTypeBlanks).Enti reRow.Delete
End Sub

I need it to do it, the other way around. Delete all rows, where the cell
in column C IS NOT empty. But there is no xlCellType for "Nonblank". So
how do I best do what I want.

Jan