OfficeUser
Well-known Member
- Joined
- Feb 4, 2010
- Messages
- 544
- Office Version
- 365
- 2016
- Platform
- Windows
I get a runtime error using this macro:
It produces an error if there are no rows to delete. How do I prevent the error from happening? This macro is triggered from within a separate macro like this:
Thanks for the help!!
Code:
Private Sub DeleteRows()
On Error Resume Next
Columns("C:C").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
On Error GoTo 0
End Sub
It produces an error if there are no rows to delete. How do I prevent the error from happening? This macro is triggered from within a separate macro like this:
Code:
Run "DeleteRows"
Thanks for the help!!