ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Deleting Null Cells (https://www.excelbanter.com/excel-discussion-misc-queries/102692-deleting-null-cells.html)

GOL

Deleting Null Cells
 
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.



Tom Hutchins

Deleting Null Cells
 
Try this:

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

Hope this helps,

Hutch

"GOL" wrote:

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.



GOL

Deleting Null Cells
 
Thanks


"Tom Hutchins" wrote:

Try this:

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

Hope this helps,

Hutch

"GOL" wrote:

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.




All times are GMT +1. The time now is 01:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com