.
Here is a small database project to review. Study the code. It has everything you are seeking but the existing code needs
to be edited to fit your specific project. (i.e, You will need to use your own variable names and also expand on the existing
code to include all the fields you are using.)
This example uses a UserForm for the data input.
Code:
Option Explicit
Private Sub btnCancel_Click()
Unload Me
End Sub
Private Sub btnOK_Click()
Dim ws As Worksheet
Set ws = ActiveSheet
Dim newRow As Long
newRow = Application.WorksheetFunction.CountA(ws.Range("A:A")) + 1
'The next two lines can be expanded as many times as needed for all the entry fields in your project
ws.Cells(newRow, 1).Value = Me.txtFirstName.Value
ws.Cells(newRow, 2).Value = Me.txtSurname.Value
End Sub
Sub CommandButton1_Click()
Selection.EntireRow.Delete
End Sub
Download file :
https://www.amazon.com/clouddrive/share/1mJIn9XSkerqNOlNHHP7T0lT15OoyeoKfIGlGZX3j2I