I have some textboxes and a button, which when clicked writes the values in the textboxes in a row, here's a screenshot:
And here's the code:
Function theLastRow() As Long
    Dim lastRow As Long
    lastRow = Sheet2.Cells(Rows.Count, 1).End(xlUp).Row
    theLastRow = lastRow
End Function
Private Sub button1_Click()
    Sheet2.Cells(theLastRow + 1, 5).Value = Comment.Value
    'cant be left empty
    If (name1.Value <> "" And name2.Value <> "" And szsz.Value <> "" And Sum.Value <> "") Then
        Sheet2.Cells(theLastRow + 1, 1).Value = name1.Value
        Sheet2.Cells(theLastRow + 1, 2).Value = name2.Value
        Sheet2.Cells(theLastRow + 1, 3).Value = szsz.Value
        Sheet2.Cells(theLastRow + 1, 4).Value = Sum.Value
    End If 
End Sub
It almost works how it's supposed to, but not exactly:
Name2, szsz and sum always start one row lower, what's the problem?


 
     
     
    