Excel/VBA - Get the row number of the first blank cell

February 2017



Issue


I need a code to fetch the row number of first blank cell in a column.

Solution


dim i as integer     
i=1     
While Sheets(5).Cells(i, 2) <> ""     
    i = i + 1     
Wend     
MsgBox i 'num of the blank line     

Thanks to Polux31 for this tip.

Related


Published by jak58. Latest update on March 26, 2013 at 10:24 AM by jak58.
This document, titled "Excel/VBA - Get the row number of the first blank cell," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (ccm.net).