Deleting lines with no data
Something like (untested):
Sub DeleteBlankRows()
Dim i As Long, rng As Range
For i = 1 To 400
If WorksheetFunction.CountA(Rows(i)) = 0 Then
If rng Is Nothing then
Set rng = Rows(i)
Else
Set rng = Union(rng, Rows(i))
End If
End If
Next
rng.Delete
End Sub
--
Vasant
"Paulo Gonçalves" wrote in message
...
I'm a newbie in excel and i want to now how can i delete a
full line in excel that have no data on it, From line 1 to
400 (Supose) i'm trying to make a code that choose all the
lines that have no data and automatic select and delete
them.
Help should be apreciated....Thank you!!
|