Hi, I'm a rookie (started today), in VBA and I've hit a problem when trying to create user a form. I've setup the form and got it to load up but when am struggling with the code that allows for entering data onto a new row and not overriding the data entered first but also how to get it so the data is saved on a different worksheet. I am not sure how to fix the problem. Would appreciate any help anyone can give me. Private Sub btnsave_Click()
Sub LastRowInOneColumn()
Dim LastRow As Long
With ActiveSheet
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
End With
MsgBox LastRow
Cells(1, 1) = txtassetname.Text
Cells(1, 2) = txtassetid.Text
Cells(1, 3) = txtserialnumber.Text
Cells(1, 4) = txtassetdescription.Text
Cells(1, 5) = txtassetdescription.Text
Cells(1, 6) = txtassetcategory.Text
Cells(1, 7) = txtassettype.Text
Cells(1, 8) = txtsupplier.Text
Cells(1, 9) = txtmanufacturer.Text
Cells(1, 10) = txtmodel.Text
Cells(1, 11) = txtmake.Text
Cells(1, 12) = txtpurchasedate.Text
Cells(1, 13) = txtpurchaseprice.Text
Cells(1, 14) = txtlocation.Text
Cells(1, 15) = txtlocationref.Text
Cells(1, 16) = txtwarrantyexpirydate.Text
Sub LastRowInOneColumn()
Dim LastRow As Long
With ActiveSheet
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
End With
MsgBox LastRow
Cells(1, 1) = txtassetname.Text
Cells(1, 2) = txtassetid.Text
Cells(1, 3) = txtserialnumber.Text
Cells(1, 4) = txtassetdescription.Text
Cells(1, 5) = txtassetdescription.Text
Cells(1, 6) = txtassetcategory.Text
Cells(1, 7) = txtassettype.Text
Cells(1, 8) = txtsupplier.Text
Cells(1, 9) = txtmanufacturer.Text
Cells(1, 10) = txtmodel.Text
Cells(1, 11) = txtmake.Text
Cells(1, 12) = txtpurchasedate.Text
Cells(1, 13) = txtpurchaseprice.Text
Cells(1, 14) = txtlocation.Text
Cells(1, 15) = txtlocationref.Text
Cells(1, 16) = txtwarrantyexpirydate.Text