Delete Empty Cells in a Macro
"fak119" wrote in message
...
1) In a range of cells (A1:B119) there are empty lines (e.g. A1:B1) which
I
want to delete in a Macro. Is this possible?
iLastRow = Cells(Rows.Count,"A").End(xlUp).Row
For i = iLastRow to 1
If Cells(i,"A").Value = "" And Cells(i,"B").Value = "" Then
Rows(i).delete
End If
Next i
2) When I sort a.m. range of cells (A1:B119), containing text, the empty
lines are on top, unless I sort descending. A way out of this other than
manually delete the emtpty cells? Hence question no. 1
|