barim
01-20-2017, 02:21 PM
I don't understand why this code works::think:
On Error Resume Next
Columns("C:C").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
and this one doesn't work::think:
Sub RowDelete()
Dim lrow2 As Long
Dim c2 As Long
For Each c2 In ActiveSheet.Range("C2:C" & lrow2)
If IsEmpty(c2) = True Then
c2.EntireRow.Delete
End If
Next c2
End Sub
The purpose is to delete entire row if it encounters any blank cell in column C. Is there any way to do it with for loop, I just feel safer doing deletions with for loop. Thanks in advance.
On Error Resume Next
Columns("C:C").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
and this one doesn't work::think:
Sub RowDelete()
Dim lrow2 As Long
Dim c2 As Long
For Each c2 In ActiveSheet.Range("C2:C" & lrow2)
If IsEmpty(c2) = True Then
c2.EntireRow.Delete
End If
Next c2
End Sub
The purpose is to delete entire row if it encounters any blank cell in column C. Is there any way to do it with for loop, I just feel safer doing deletions with for loop. Thanks in advance.