View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default AUTOMATIC DELETE

Your looping over all cells in the usedrange and if any of them are blank,
deleting the entire row.

if that is what you want to do, simpler would be:

Dim rng as Range
set rng = Sheets("Sheet1").Cells.Specialcells(xlblanks).Enti reRow
if not rng is nothing then
rng.delete
End if

--
Regards,
Tom Ogilvy


"zebra" wrote in message
...
Could anyone please tell me how to write a sub() to automatically delete
null numval lines in a sheet viz
sub DelNul()
Dim Cell As Range
For Each Cell In Sheets("'Sheet1").UsedRange
If Sheets("Sheet1").Range(Cell.Address).value - vbNullString Then
Delete Line 'OR SOMETHING LIKE THIS?
Else
End If
Next
End Sub