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

December 2016



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 :

This document entitled « Excel/VBA - Get the row number of the first blank cell » from CCM (ccm.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.