Hi,
I've looked through the forum but can't find this precis issue.
I have a spreadsheet which I look for the values in a column (column C), and if the cell value = zero, the row is deleted. this works from the bottom of the sheet and looks at all rows up to row 11. The code for this is below.
This works fine, but what I want now is to do something similar, but only looking at a specific range of rows, namely rows 11-20 in column 'E' - deleting the row if the cell value in column E = 0. I can't seem to get it to work - any help would be greatly appreciated! Thanks
I've looked through the forum but can't find this precis issue.
I have a spreadsheet which I look for the values in a column (column C), and if the cell value = zero, the row is deleted. this works from the bottom of the sheet and looks at all rows up to row 11. The code for this is below.
Code:
Sub DelRow()
Dim LR As Long, i As Long
LR = Range("C" & Rows.Count).End(xlUp).Row
For i = LR To 11 Step -1
If Range("C" & i).Value = 0 Then Rows(i).delete
Next i
End Sub
This works fine, but what I want now is to do something similar, but only looking at a specific range of rows, namely rows 11-20 in column 'E' - deleting the row if the cell value in column E = 0. I can't seem to get it to work - any help would be greatly appreciated! Thanks