Finding Next Empty Cell in Column
Hi Steve,
There may be a number of ways to accomplish this but I'll send you a couple
of solutions that immediately occur to me. I'm first going to assume that
you're making cell entries in a single column (if I'm wrong, please let me
know). Let's say that your data entries begin in cell A6. You want your
code to locate the next data entry cell in column A (the first blank cell
below A6). One way to do this is:
Method 1: Find the last possible data entry cell in the column then do and
"End Up"
Sub FindNextCell()
'Locate the next data entry cell in data entry column A
If Range("A65536").Value = "" Then
Range("A65536").Select
Selection.End(xlUp).Select
Else
MsgBox "You have filled the data entry column"
End If
End Sub
Method 2: Loop through the data entry cells until you find the first blank
Sub FindNextCell()
'Locate the next data entry cell in data entry column A
Dim FirstCell As String
Dim i As Integer
FirstCell = "A6"
Range(FirstCell).Select
Do Until ActiveCell.Value = ""
If ActiveCell.Value = "" Then
Exit Do
Else
ActiveCell.Offset(1, 0).Select
End If
Loop
End Sub
"caldog" wrote:
Hope this question hasn't come up to often. I can't find where it was asked
before so here goes.
I would like to find the next empty cell below my last entry. What VBA code
would I use to accomplish this.
Steve
|