I can't understand why the cmbAddRecord sub on the attached worksheet is not populating the next record??

I am trying to update the attached worksheet with additional records, but the new record is not populating.  Could you please explain why?

Thank you!
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

This macro sets the text in the input boxes to blank before using them.;
Private Sub cmbAddRecord_Click()
Dim lastrow As Long
lastrow = Sheets("sheet1").Range("A" & Rows.Count).End(xlUp).Row

txtNumber.Text = ""
cboCategory.Text = ""
txtName.Value = ""
TextBox1.Value = ""
txtCreator.Value = ""
txtOwner.Value = ""
cboContainer.Value = ""
cboClass.Value = ""
txtCustodian.Value = ""
txtYears.Value = ""
cboProtect.Value = ""

With Me
Cells(lastrow + 1, "A").Value = txtNumber.Text
Cells(lastrow + 1, "B").Value = cboCategory.Text
Cells(lastrow + 1, 3).Value = txtName.Text
Cells(lastrow + 1, 4).Value = TextBox1.Text
Cells(lastrow + 1, 5).Value = txtCreator.Text
Cells(lastrow + 1, 6).Value = txtOwner.Text
Cells(lastrow + 1, 7).Value = cboContainer.Text
Cells(lastrow + 1, 8).Value = cboClass.Text
Cells(lastrow + 1, 9).Value = txtCustodian.Text
Cells(lastrow + 1, 10).Value = txtYears.Text
Cells(lastrow + 1, 11).Value = cboProtect.Text
End With

End Sub

Open in new window

Leave out lines 5 to 15, or move all that block to after the Cells updateing lines

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mcarsonsrAuthor Commented:
Thank you GrahamSkan, but this leads to another question.  The code I have initializes the userform with the first row of data in the text boxes.  As a result, when I press the add button, the first row is appended as the next row at the end of the data.  How do I set the add button so that it is clear of existing data and ready for the input of new data to append to as the next row at the end of the data.

I am sure it is a fairly simple fix, but I am very new to VBA.

Thank you
Martin LissOlder than dirtCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.