vba - Why is Rows(i).EntireRow.Delete deleting the cell instead of the row? -
instead of entire row being deleted, cell(i,8) gets deleted. code is, each cell until last row, if cell starts im, highlight it, , if corresponding cell less 4, delete row. thanks
for = 1 lastrow if left(cells(i, 1), 2) = "im" cells(i, 1).interior.color = rgb(140, 220, 100) if cells(i, 8).value <= 4 rows(i).entirerow.delete end if end if next
open immediate window. write these two:
rows(5).entirerow.delete rows(5).delete
see row 5 gets deleted. code wrong, running else.
Comments
Post a Comment