Get Started
Plugins
Macros
More information

Next blank row

Description

Find the next available blank row in a worksheet. This macro allows you to get the blank at the very end of your data (not between it).

(function () 
{
    // Getting the active sheet
    activeSheet = Api.ActiveSheet;
    // Minimum row index
    indexRowMin = 0;
    // Maximum row index
    indexRowMax = 1048576;
    // Column 'A'
    indexCol = 0;
    // Row index for empty cell search
    indexRow = indexRowMax;
    for (; indexRow >= indexRowMin; --indexRow) {
        // Getting the cell
        range = activeSheet.GetRangeByNumber(indexRow, indexCol);
        // Checking the value
        if (range.GetValue() && indexRow !== indexRowMax) {
            range = activeSheet.GetRangeByNumber(indexRow + 1, indexCol);
            range.Select();
            break;
        }
    }
})();

Methods used: GetActiveSheet, GetRangeByNumber, Select

Reference Microsoft VBA macro code

This VBA macro was used as a base.

Sub example()
    Range("A" & Rows.Count).End(xlUp).Offset(1).Select
End Sub
Result

Next blank row