PDA

View Full Version : find next blank row and input information from form



miketallica
09-21-2009, 11:04 AM
i have a spread sheet with 5 columns Name, Address, Tel, Fax, Cell. what i want to do is make a userform that pops up, i enter the information and when i click ok it finds the next row in my spreadsheet that's blank. i think i can figure out how to get the info from the form to the specific cell but i just dont know how to tell it to find the next blank row to put in the info in. thanks

Bob Phillips
09-21-2009, 11:15 AM
Dim NextRow As Long

If Range("A1").Value = "" Then

NextRow = 1
ElseIf Range("A2").Value = "" Then

NextRow = 2
Else

NextRow = Range("A1").End(xlDown).Row + 1
End If

ndendrinos
09-21-2009, 11:20 AM
here is a working example

Sandeepn
09-22-2009, 08:59 AM
I dont know if this would solve, but here is the code.

Sub Findblankcell()
j = 0
i = ActiveCell.Row
Do
j = j + 1
Loop While Cells(i, j) <> ""
Cells(i, j).Activate
End Sub

Attached is the Workbook with the code in it.

It always goes to the first blank cell in the row.....that could be a headache if you have intentionally left that cell blank