excel - Need the last row number which contain comment -
i'm trying clear entire row of cells containing comment. want last active row number contains comment. i've used lastrow = worksheets("sheet1").cells(worksheets("sheet1").rows.count, "b").end(xlup).row
but returning last row number contains value.if cell has comment no value it's not giving last row number.
any alternative suggestion clearing cell comments entire column welcome.
thanks in advance.
my code clear value below. want clear comments well.
sub columnclear() dim lastrow long dim long lastrow = worksheets("sheet1").cells(worksheets("sheet1").rows.count, "b").end(xlup).row = 3 lastrow worksheets("sheet1").cells(i, 2).value = empty next end sub
try this:
lastrow = worksheets("sheet1").comments(worksheets("sheet1").comments.count).parent.row
this last comment in whole sheet hope ok.
Comments
Post a Comment