Giri
07-06-2011, 09:36 PM
Hi Guys,
I am trying to make a simple macro that deletes empty cells, but for some reeason the code below keeps skipping over any empty cells it encounters... Essentially, nothing is happening.. lol.
Any help with this would be greatly appreciated!
Kind Regards,
Giri
Public Sub DeleteEmpty()
Dim row As Integer
Dim c
row = Range("D:D").End(xlDown).row
For Each c In Range("D1:D" & row)
c.Select
If IsEmpty(ActiveCell) = True Then
ActiveCell.Delete
End If
Next c
End Sub
I am trying to make a simple macro that deletes empty cells, but for some reeason the code below keeps skipping over any empty cells it encounters... Essentially, nothing is happening.. lol.
Any help with this would be greatly appreciated!
Kind Regards,
Giri
Public Sub DeleteEmpty()
Dim row As Integer
Dim c
row = Range("D:D").End(xlDown).row
For Each c In Range("D1:D" & row)
c.Select
If IsEmpty(ActiveCell) = True Then
ActiveCell.Delete
End If
Next c
End Sub