Mavis Beacon
03-05-2013, 06:51 AM
Hello,
My data set has a number of columns, all of which have a different number of cells.
I'm trying to clean my data by removing blank cells before I run macro as when I use the .End(xlDown) function it runs for cells that are blank.
I've tried using the specialcells(xlcelltypeblanks).delete and IsEmpty but these only seem to work for entire rows that are blank. I also tried using this code:
Dim row As Variant
Dim i
row = Range("A3:BZ234")
For Each i In Range("A3:BZ234")
i.Select
If ActiveCell.Value = 0 Then
ActiveCell.Delete Shift:=xlShiftUp
End If
Next i
but it still leaves blank cells (of different amounts!?) under each column. I'm at a loss. Any help/advice would be greatly appreciated.
My data set has a number of columns, all of which have a different number of cells.
I'm trying to clean my data by removing blank cells before I run macro as when I use the .End(xlDown) function it runs for cells that are blank.
I've tried using the specialcells(xlcelltypeblanks).delete and IsEmpty but these only seem to work for entire rows that are blank. I also tried using this code:
Dim row As Variant
Dim i
row = Range("A3:BZ234")
For Each i In Range("A3:BZ234")
i.Select
If ActiveCell.Value = 0 Then
ActiveCell.Delete Shift:=xlShiftUp
End If
Next i
but it still leaves blank cells (of different amounts!?) under each column. I'm at a loss. Any help/advice would be greatly appreciated.