Find next blank cell within a RANGE of a column.

Gashmore

New Member
Joined
Jun 20, 2017
Messages
6
I have found several techniques for finding the next blank cell in a column but none to limit the search to a range within a column.

The specifics: The worksheet is for scoring a sailboat race. There is a userform for entering the boat specifics into a table that consist of the entry #, boat name, class, handicap, etc.

The table starts at Row 11 and Column A is pre-loaded with Entry numbers from 1 to 30. I want to initialize the form with the next available Entry#. I want to search the range "BoatNames" ( B11:B31) for the next unused cell then load the form text box Entry_Number with the value in column A.
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
I have found several techniques for finding the next blank cell in a column but none to limit the search to a range within a column.

The specifics: The worksheet is for scoring a sailboat race. There is a userform for entering the boat specifics into a table that consist of the entry #, boat name, class, handicap, etc.

The table starts at Row 11 and Column A is pre-loaded with Entry numbers from 1 to 30. I want to initialize the form with the next available Entry#. I want to search the range "BoatNames" ( B11:B31) for the next unused cell then load the form text box Entry_Number with the value in column A.

Welcome to the board.

Will there ever be any information in Column B below row 31?
 
Upvote 0
Right now I have sized the sheet for 20 boats but it could get larger.

That doesn't answer the question though. Is there any data on the sheet below the last possible boat name in Column B? Other tables/data etc?
 
Upvote 0
Here are two alternatives to find the last used row, then add 1 to get the blank row beyond.

Code:
Sub FindNxtBlank()
Dim ws As Worksheet
Dim r As Long
Set ws = ActiveSheet
Code:
'This will find the last used row on the sheet starting at the bottom and looking up.
r = ws.Cells(Rows.Count, "B").End(xlUp).Row + 1
Code:
'This will find the last used row in the range starting from B11 and looking down.
r = ws.Range("B11").End(xlDown).Row + 1

Then you can use r to identify the row in Column A to use to populate the userform text box.
 
Last edited:
Upvote 0
Oh! No. The table is the end of the sheet.

Ok, then the first option from post #5 should do the trick just fine.. so probably something like this:

Code:
Dim ws As Worksheet
Dim r As Long
Set ws = ActiveSheet
r = ws.Cells(Rows.Count, "B").End(xlUp).Row + 1
UserForm1.TextBox1.Text = CStr(Range("A" & r).Value)
 
Upvote 0

Forum statistics

Threads
1,216,100
Messages
6,128,831
Members
449,471
Latest member
lachbee

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top