Hello,
I have the following code
This is designed to remove rows when the cell in column 4 is blank. However, if all columns are full, I get "subscript out of range".
I've done some researching and I've being trying to understand how to have the code handle errors. What I need is for it to simply ignore deleting rows altogether if column 4 does not contain cells of blank data.
From my understanding,
would require the next line of code to correct for the error - but how do i do this?
I appreciate your help.
I have the following code
Code:
'remove rows of blank data (if data is not entered)
Sub deleterows()
Sheets("Page 1").Select
Columns(4).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
End Sub
I've done some researching and I've being trying to understand how to have the code handle errors. What I need is for it to simply ignore deleting rows altogether if column 4 does not contain cells of blank data.
From my understanding,
Code:
'remove rows of blank data (if data is not entered)
Sub deleterows()
Sheets("Page 1").Select
Columns(4).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
On Error Resume Next
End Sub
I appreciate your help.