Deleting Null Cells

G

GOL

I would like a macro that deletes All Null Cells in a spreadsheet.

For Example

aaa Null 123
bbb 123 Null 123

Would look like

aaa 123
bbb 123 123

I would like the Null Cells Delete and everything to come to the left.
 
T

Tom Hutchins

Try this:

Sub DeleteBlankCells()
ActiveSheet.Cells.SpecialCells(xlCellTypeBlanks).Select
Selection.Delete Shift:=xlToLeft
Range("A1").Select
End Sub

Hope this helps,

Hutch
 
G

GOL

Thanks


Tom Hutchins said:
Try this:

Sub DeleteBlankCells()
ActiveSheet.Cells.SpecialCells(xlCellTypeBlanks).Select
Selection.Delete Shift:=xlToLeft
Range("A1").Select
End Sub

Hope this helps,

Hutch
 
Top