J
Janis
Hi
I get a runtime 1004 application or object defined error when I run this. I
want to delete the rows with blanks in column "M".
TIA
-------------code---------
Public Sub deleteRows()
Dim rngToDelete As Range
With ActiveSheet
On Error Resume Next
Set rngToDelete = .Range(.Range("M1"), .Cells(Rows.Count,
"M").End(xlUp)).SpecialCells(xlCellTypeBlanks)
On Error GoTo 0
End With
If Not rngToDelete Is Nothing Then rngToDelete.EntireRow.Delete
End Sub
I get a runtime 1004 application or object defined error when I run this. I
want to delete the rows with blanks in column "M".
TIA
-------------code---------
Public Sub deleteRows()
Dim rngToDelete As Range
With ActiveSheet
On Error Resume Next
Set rngToDelete = .Range(.Range("M1"), .Cells(Rows.Count,
"M").End(xlUp)).SpecialCells(xlCellTypeBlanks)
On Error GoTo 0
End With
If Not rngToDelete Is Nothing Then rngToDelete.EntireRow.Delete
End Sub