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 

excel ss

try this:

lastrow = worksheets("sheet1").comments(worksheets("sheet1").comments.count).parent.row 

this last comment in whole sheet hope ok.


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

.htaccess - Matching full URL in RewriteCond -