ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   delete rows with empty cells throughout the data (https://www.excelbanter.com/excel-worksheet-functions/166381-delete-rows-empty-cells-throughout-data.html)

rutski

delete rows with empty cells throughout the data
 
How would i delete the rows of data if any of the cells are empty for
say a range a1 to i400?

thanks,

gr


Bernie Deitrick

delete rows with empty cells throughout the data
 
gr,

Range("A1:I400").SpecialCells(xlCellTypeBlanks).En tireRow.Delete

HTH,
Bernie
MS Excel MVP


"rutski" wrote in message
...
How would i delete the rows of data if any of the cells are empty for
say a range a1 to i400?

thanks,

gr




ryguy7272

delete rows with empty cells throughout the data
 
This will delete the entire row if the cell in ColumnA is blank:
Sub delete_rows()
Dim RowNdx As Long
Dim LastRow As Long
LastRow = ActiveSheet.UsedRange.Rows.Count
For RowNdx = LastRow To 1 Step -1
If Cells(RowNdx, "A").Value = "" Then
Rows(RowNdx).Delete
End If
Next RowNdx
End Sub


Regards,
Ryan---

--
RyGuy


"Bernie Deitrick" wrote:

gr,

Range("A1:I400").SpecialCells(xlCellTypeBlanks).En tireRow.Delete

HTH,
Bernie
MS Excel MVP


"rutski" wrote in message
...
How would i delete the rows of data if any of the cells are empty for
say a range a1 to i400?

thanks,

gr





rutski

delete rows with empty cells throughout the data
 
On Nov 16, 10:22 am, "Bernie Deitrick" <deitbe @ consumer dot org
wrote:
gr,

Range("A1:I400").SpecialCells(xlCellTypeBlanks).En tireRow.Delete

HTH,
Bernie
MS Excel MVP

"rutski" wrote in message

...

How would i delete the rows of data if any of the cells are empty for
say a range a1 to i400?


thanks,


gr


thanks Bernie

rutski

delete rows with empty cells throughout the data
 
On Nov 16, 10:44 am, ryguy7272
wrote:
This will delete the entire row if the cell in ColumnA is blank:
Sub delete_rows()
Dim RowNdx As Long
Dim LastRow As Long
LastRow = ActiveSheet.UsedRange.Rows.Count
For RowNdx = LastRow To 1 Step -1
If Cells(RowNdx, "A").Value = "" Then
Rows(RowNdx).Delete
End If
Next RowNdx
End Sub

Regards,
Ryan---

--
RyGuy

"Bernie Deitrick" wrote:
gr,


Range("A1:I400").SpecialCells(xlCellTypeBlanks).En tireRow.Delete


HTH,
Bernie
MS Excel MVP


"rutski" wrote in message
...
How would i delete the rows of data if any of the cells are empty for
say a range a1 to i400?


thanks,


gr


thanks ryguy


All times are GMT +1. The time now is 07:23 AM.

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