Do Loop

Create a UDF named "RowNo" that takes as input a column number (1 for column A, 2 for column B, etc.) and returns the row number of the first blank cell encountered. Use a Do loop—either a Do While or Do Until loop—in your function.

Figure 21.7: Sample data for RowNo function.

For example, RowNo(1) would return 28 on this worksheet. Here, the 1 that is passed to the function represents column A.

The following is a sample solution of how this could be done.

Show Code