ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   Delete a row if blank cell (https://www.excelbanter.com/new-users-excel/83101-delete-row-if-blank-cell.html)

mohd21uk via OfficeKB.com

Delete a row if blank cell
 
Hi,

I would like to delete a row if the a cell in a column is blank. For e.g. if
a cell in column E is blank I would like to delete the whole row. I would
like to do this in VBA code

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...l-new/200604/1

CLR

Delete a row if blank cell
 
Here's one I got from the group some time ago.....sorry, don't remember who
or when..........

Public Sub DeleteBlanks()
With ActiveSheet
.Range(.Cells(1, ActiveCell.Column), _
.Cells(65536, ActiveCell.Column)).Select
End With
Selection.SpecialCells(xlCellTypeBlanks).EntireRow .Delete
ActiveSheet.UsedRange
ActiveCell.Select
End Sub

Vaya con Dios,
Chuck, CABGx3



"mohd21uk via OfficeKB.com" wrote:

Hi,

I would like to delete a row if the a cell in a column is blank. For e.g. if
a cell in column E is blank I would like to delete the whole row. I would
like to do this in VBA code

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...l-new/200604/1


Don Guillett

Delete a row if blank cell
 
or

Sub DeleteBlankRowsInActiveColumn()
ac = ActiveCell.Column
lr = Cells(Rows.Count, ActiveCell.Column).End(xlUp).Row
Range(Cells(1, ac), Cells(lr, ac)). _
SpecialCells(xlCellTypeBlanks).EntireRow.Delete
End Sub

--
Don Guillett
SalesAid Software

"mohd21uk via OfficeKB.com" <u20517@uwe wrote in message
news:5eb7b0aab4723@uwe...
Hi,

I would like to delete a row if the a cell in a column is blank. For e.g.
if
a cell in column E is blank I would like to delete the whole row. I would
like to do this in VBA code

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...l-new/200604/1




All times are GMT +1. The time now is 03:08 AM.

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